Option Explicit
Private Sub CommandButton1_Click()
Dim rngC As Range, lngEnde As Long
lngEnde = Cells(Rows.Count, 1).End(xlUp).Row
For Each rngC In Range("B2:D" & lngEnde)
Select Case rngC.Column
Case Is = 2
If rngC.Value = WorksheetFunction.Max(Range(Cells(1, 2), Cells(lngEnde, 2))) Then
Cells(Cells(Rows.Count, 6).End(xlUp).Row + 1, 6) = rngC.Offset(0, -1).Value
End If
Case Is = 3
If rngC.Value = WorksheetFunction.Max(Range(Cells(1, 3), Cells(lngEnde, 3))) Then
Cells(Cells(Rows.Count, 7).End(xlUp).Row + 1, 7) = rngC.Offset(0, -2).Value
End If
Case Is = 4
If rngC.Value = WorksheetFunction.Max(Range(Cells(1, 4), Cells(lngEnde, 4))) Then
Cells(Cells(Rows.Count, 8).End(xlUp).Row + 1, 8) = rngC.Offset(0, -3).Value
End If
End Select
Next
End Sub
Zellen auffüllen!
Platin7 13.07.2007 - 40 Hits - 24 Antworten
Durchschnittswwert ermitteln
Mrfivejunior 27.07.2007 - 76 Hits - 7 Antworten
Excel Datum HEUTE Zeilen übernehmen
heimlichen 03.11.2007 - 107 Hits - 6 Antworten
Access Min max Abfrage
ratlosinaccess 23.04.2008 - 277 Hits - 4 Antworten