jeffreybrown
Well-known Member
- Joined
- Jul 28, 2004
- Messages
- 5,152
I run the procedure below from another procedure, but I get a run time errro.
Run Time error '1004'
Copy method of Range class failed
However, if I run the macro manually by going into the VBE and selecting F5 it runs just fine.
When I step through the procedure x is receiving a numberical value.
Any thoughts? What have I missed?
Run Time error '1004'
Copy method of Range class failed
However, if I run the macro manually by going into the VBE and selecting F5 it runs just fine.
When I step through the procedure x is receiving a numberical value.
Any thoughts? What have I missed?
Code:
Sub UpdateCharts()
Dim x As Long
Dim i As Long
x = Sheets("Sheet1").Range("C2").Value
With Sheets("Charts")
For i = 2 To 6
.Range("Q" & i).Copy Range("Q" & i).Resize(, x)
Next i
End With
End Sub