Hey everyone. I have the following lines of code:
It's a very simple VBA code which I want to expand on, but I'm unsure why I run the program and it doesn't generate any values. If it helps, my current code has 25 columns and 1000 Rows (but RowCount and ColumnCount work). I just want to know what exactly is wrong with my For loop.
Code:
Sub Ones()
Dim RowCount As Long
Dim ColumnCount As Long
'Counts the number of rows within
RowCount = ActiveSheet.Cells(ActiveSheet.Rows.Count, "A").End(xlUp).Row
ColumnCount = ActiveSheet.Cells(1, Columns.Count).End(xlToLeft).Column
For i = 2 To i = RowCount
Cells(i, ColumnCount + 1).Value = "1"
Next I
End Sub
It's a very simple VBA code which I want to expand on, but I'm unsure why I run the program and it doesn't generate any values. If it helps, my current code has 25 columns and 1000 Rows (but RowCount and ColumnCount work). I just want to know what exactly is wrong with my For loop.
Last edited: