VBA_Noob002
New Member
- Joined
- Mar 29, 2016
- Messages
- 5
Hi Guys, I get an invalid Next control variable reference for the below code, please advise
Code:
Sub TRP()
Dim X As Long
Dim Y As Long
For X = 1 To 32
For Y = 1 To 32
With Workbooks("TB.xlsx").Worksheets("XM").Range(Cells(112, X + 2), Cells(112, X + 4)).Copy
End With
With Workbooks("HB.xlsm").Worksheets("XMR").Range(Cells(Y + 1, X + 3), Cells(Y + 1, X + 5)).Select
ActiveSheet.PasteSpecial Paste:=xlValues, Operation:=xlNone, Skipblanks:=False, Transpose:=False
End With
Next X
Next Y
End Sub
Last edited by a moderator: