VBA_Noob002
New Member
- Joined
- Mar 29, 2016
- Messages
- 5
Hi guys, I get an application defined/Object defined error for the below, any help is much appreciated!
Code:
Sub Macro1()
'
' Macro1 Macro
'
'
For Y = 1 To 12
For Z = 1 To 50
For A = 1 To 50
For B = 1 To 50
X = Z + 3
C = A + 4
D = B + 5
ThisWorkbook.Worksheets("XMR").Range(Cells(Y + 1, 4)).Select
ActiveCell.FormulaR1C1 = "='[File.xlsx]SM'!R148C" & X
ThisWorkbook.Worksheets("XMR").Range(Cells(Y + 1, 5)).Select
ActiveCell.FormulaR1C1 = "='[File.xlsx]SM'!R148C" & C
ThisWorkbook.Worksheets("XMR").Range(Cells(Y + 1, 6)).Select
ActiveCell.FormulaR1C1 = "='[File.xlsx]SM'!R148C" & D
Next B
Next A
Next Z
Next Y
End Sub
Last edited by a moderator: