I'm trying to print 0 and 1 in a range of cell but I can't get it work: I keep getting all 0 values
Dim myRange As Range, i As Integer, b As Integer
ActiveSheet.Range("A1:a10").Select
i = 1
For Each myRange In Selection.Cells
b = i - 1
myRange.Value = b
i = b + i
Next
Dim myRange As Range, i As Integer, b As Integer
ActiveSheet.Range("A1:a10").Select
i = 1
For Each myRange In Selection.Cells
b = i - 1
myRange.Value = b
i = b + i
Next