Sub Test()
MitFormel 3, 1, 2, 2000
MitWerten 1, 1, 2, 2000
End Sub
Private Function MitFormel(Spalte As Long, StartWert As Integer, StartZeile As Long, LetzteZeile As Long)
With Cells(StartZeile, Spalte)
.Value = StartWert
With .Offset(1).Resize(LetzteZeile - StartZeile)
.FormulaR1C1 = "=IF(ISEVEN(ROW()),R[-2]C+1,"""")"
End With
End With
End Function
Private Function MitWerten(Spalte As Long, StartWert As Integer, StartZeile As Long, LetzteZeile As Long)
With Cells(StartZeile, Spalte)
.Value = StartWert
With .Offset(1).Resize(LetzteZeile - StartZeile)
.FormulaR1C1 = "=IF(ISEVEN(ROW()),R[-2]C+1,"""")"
.Value = .Value
End With
End With
End Function
|