Gruppe
UDF
Problem
Wie kann ich wahlweise alle geraden oder ungeraden Zeilen summieren?
StandardModule: basMain
Function BlnSum(rng As Range, bln As Boolean) As Double
Dim dbl As Double
Dim intRow As Integer, rngAct As Range
For intRow = 1 To rng.Rows.Count
If bln = False Then
If rng.Cells(intRow).Row Mod 2 = 0 Then dbl = _
dbl + rng.Cells(intRow).Value
Else
If rng.Cells(intRow).Row Mod 2 <> 0 Then dbl = _
dbl + rng.Cells(intRow).Value
End If
Next intRow
BlnSum = dbl
End Function