2
I need help with vba. When inserting values using Line counter, I want to change column, every N number of rows.
E.g.: every 100 rows counted and automatically inserted values, the column is changing and the row count resumes in a new column. I can change lines using row counter but can’t do the same p columns.
Here is the status of the code:
Sub numberlist()
Application.Screenupdating = False
Application.Calculation = xlCalculationManual
Dim a1 As Single
Dim b1 As Single
Dim c1 As Single
Dim count As Integer
Dim lrow As Long
Dim lcolumn As Integer
a1 = 0
b1 = 0
c1 = 0
For a1 = 0 To 9 Step 1
For b1 = 0 To 9 Step 1
For c1 = 0 To 9 Step 1
lrow = Cells(Rows.count, "A").End(xlUp).Row + 1
Cells(lrow, "A") = a1 & b1 & c1
If lrow Mod 100 = 0 Then
Application.EnableEvents = False
lcolumn = Range(1, Columns.count).Next(xlToRight).Column + 1
lrow = 0
lrow = Cells(Rows.count, Columns.count).End(xlUp).Row + 1
Cells(lrow, "A") = a1 & b1 & c1
Else
End If
Next
Next
Next
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub