Hi, I am trying to copy a range from one worksheet to another. Basically I have one long column of data (the data set repeats after 45 lines) and I want to copy it to multiple columns of 45 rows.
When I run the code I get run time error 1004: Method 'Range' of object'_Global' failed - the red line is where the error occurs
I think that this is the only relevant part of the code:
Dim Side1 As Integer
Dim Side2 As Integer
Dim col As Integer
Side1 = 45
col = 9
If NumParts <= 9 Then
For row = 1 To (NumParts * Side1) Step 45
Range(Worksheets(sheet1name).Cells(1, col), Worksheets(sheet1name).Cells(45, col)).Value = Range(Worksheets(sheet3name).Cells(row, 1), Worksheets(sheet1name).Cells((row + 44), 1)).Value
col = col + 1
Next
End If
Any advice would be great
Thanks,
When I run the code I get run time error 1004: Method 'Range' of object'_Global' failed - the red line is where the error occurs
I think that this is the only relevant part of the code:
Dim Side1 As Integer
Dim Side2 As Integer
Dim col As Integer
Side1 = 45
col = 9
If NumParts <= 9 Then
For row = 1 To (NumParts * Side1) Step 45
Range(Worksheets(sheet1name).Cells(1, col), Worksheets(sheet1name).Cells(45, col)).Value = Range(Worksheets(sheet3name).Cells(row, 1), Worksheets(sheet1name).Cells((row + 44), 1)).Value
col = col + 1
Next
End If
Any advice would be great
Thanks,