Hallo phtagen,
ich meine, dein Makro müsste etwa so aussehen:
Sub mittelwerte1()
For i = 1 To Cells(Rows.Count, 1).End(xlUp).Row Step 24
Cells((i - 1) / 24 + 1, 2) = WorksheetFunction.SumIf(Range(Cells(i, 1), _
Cells(i + 23, 1)), ">0") / WorksheetFunction.CountIf(Range(Cells(i, 1), _
Cells(i + 23, 1)), ">0")
Next i
End Sub
Gruß
Holger
phtagen schrieb am 31.07.2009 08:46:29:
hallo holger,
danke für deine antwort... leider klappt es immer noch nich... irgendwas is da noch faul...
vielleicht haste ja mal zeit rüber zu gucken???
gruß
phtagen
Quelltext:
Sub mittelwerte1()
Dim mittelwert As Single
ende = Cells(Rows.Count, 1).End(xlUp).Row
laufvariable = Cells(Rows.Count, 1).End(xlUp).Row / 24
For i = ende To 1 Step -23
For y = laufvariable To 1 Step -1
mittelwert = WorksheetFunction.SumIf(Range(Cells(i, 1), Cells(i - 23, 1)), ">0") / WorksheetFunction.CountIf(Range(Cells(i, 1), Cells(i - 23, 1)), ">0")
Next y
Next i
End Sub |