I am getting an object defined error with the below code. Any idea what could i be doing wrong? Thanks
Sub Loop_Test2()
Dim i As Integer
Dim j As Integer
Dim CountAll As Integer
Dim CountXL As Integer
ActiveSheet.Range("A1").Activate
CountAll = ActiveSheet.Range("A35")
MsgBox CountAll
For j = 1 To CountAll
i = 1
This is where the error occurs:
CountXL = Cells(i, j).Value
Continued:
MsgBox CountXL
For i = 1 To CountXL + 2
Cells(i + 2, j) = "Row " & i & " Col " & j
Next i
Next j
End Sub
I think it is an incorrect assignment. I'm not familiar with the correct syntax.
Error Details: "Run time error 1004. Application defined or object defined error