I am trying to copy the range specified in parts to different positions on another worksheet but simply get the run time error 1004.
It says Range of Object_Worksheet failed.
I do not understand why it is failing.
Please help
It says Range of Object_Worksheet failed.
I do not understand why it is failing.
Please help
Code:
Dim coprng As Range
Dim onrng As Range
Dim rawsheet As Worksheet
Dim tsheet As Worksheet
Dim j As Long
Dim i As Long
For j = 0 To 2
For i = 0 To 5
Set coprng = rawsheet.Range(Cells(182 + (80 * i) + (10 * j), 1), Cells(182 + 9 + 80 * i + 10 * j, 1))
Set onrng = tsheet.Range(Cells(68 + 35 * i, 7 + 14 * j), Cells(68 + 35 * i + 9, 7 + 14 * j))
coprng.Copy onrng
Next i
Next j