ich hoffe mal, daß rainer, alias ramses dieses posting hier liest...
vielen dank nochmal für deinen code (s.u.) - nur : kannst du mir vielleicht noch verraten, wie ich den code so anpasse, daß erst in der vierten zeile angefangen wird zu zählen....denn ansonsten zählt er die überschriften mit...(blöd)...
Function Special_CountIf() As String
Application.Volatile
Dim lRow1 As Integer, lRow2 As Integer
Dim i As Integer, cellCounter As Byte
Dim tmpSum1 As Double, tmpSum2 As Double
lRow1 = Cells(65536, 1).End(xlUp).Row
lRow2 = Cells(65536, 2).End(xlUp).Row
cellCounter = 0
tmpSum1 = 0
tmpSum2 = 0
If lRow1 > lRow2 Then
For i = lRow1 To 1 Step -1
If Not IsEmpty(Cells(i, 1)) Then
If cellCounter = 24 Then Exit For
tmpSum1 = tmpSum1 + 1
cellCounter = cellCounter + 1
End If
If Not IsEmpty(Cells(i, 2)) Then
If cellCounter = 24 Then Exit For
tmpSum2 = tmpSum2 + 1
cellCounter = cellCounter + 1
End If
Next i
Else
cellCounter = 0
For i = lRow2 To 1 Step -1
If Not IsEmpty(Cells(i, 1)) Then
If cellCounter = 24 Then Exit For
tmpSum1 = tmpSum1 + 1
cellCounter = cellCounter + 1
End If
If Not IsEmpty(Cells(i, 2)) Then
If cellCounter = 24 Then Exit For
tmpSum2 = tmpSum2 + 1
cellCounter = cellCounter + 1
End If
Next i
End If
Special_CountIf = tmpSum1 & "/" & tmpSum2
End Function
special greetings
from jake.