pedie
Well-known Member
- Joined
- Apr 28, 2010
- Messages
- 3,875
Compile Error - Invalid next control reference. Please tell me what 'm doing wrong...
Thanks in advance
Thanks in advance
Code:
[FONT=Courier New]Option Explicit[/FONT]
[FONT=Courier New]Sub test2()[/FONT]
[FONT=Courier New]Dim i, j As Integer
Dim lr, lr2 As Long[/FONT]
[FONT=Courier New]lr = Sheets("Jan").Cells(Rows.Count, "A").End(xlUp).Row
lr2 = Sheets("Feb").Cells(Rows.Count, "A").End(xlUp).Row[/FONT]
[FONT=Courier New]For i = 1 To lr
For j = 2 To lr2
Debug.Print Cells(i, "A")
Debug.Print Cells(j, "A")[/FONT]
[FONT=Courier New]Next i
Next j[/FONT]
[FONT=Courier New]End Sub[/FONT]