Gruppe
UDF
Problem
Die benutzerdefinierten Funktionen in Spalte D sollen die Minimalzeiten je Athlet und Disziplin ermitteln.
StandardModule: Modul1
Function GetMinimum( _
sAthlet As String, _
sDisziplin As String, _
rng As Range) As Date
Dim datTemp As Date
Dim iRow As Integer
Application.Volatile
datTemp = WorksheetFunction.Max(rng)
For iRow = 1 To rng.Rows.Count
If Cells(iRow, 1).Value = sAthlet And _
Cells(iRow, 2).Value = sDisziplin Then
If datTemp > Cells(iRow, 3).Value Then
datTemp = Cells(iRow, 3).Value
End If
End If
Next iRow
GetMinimum = datTemp
End Function