0

I'm new to VBA in Excel and I need to copy some data from Sheet2 to Sheet1. Since eventually I want to write a for loop that runs through both rows and columns, I wanted to use the following code:

Worksheets("Sheet2").Range(Cells(2,6),Cells(5,16)).Copy Worksheets("Sheet1").Range(Cells(3,2),Cells(6,12))

But I'm getting error 1004 for some reason. Same if I put .Cells instead of Cells

I'm confused because I've seen the code Range(Cells(),Cells()) elsewhere and I am not sure why it is not working. I can be more explicit with the original issue if needed,

Thanks for your help

  • `With Worksheets("Sheet2")`, `.Range(.Cells(2, 6), .Cells(5, 16)).Copy Destination:=Worksheets("Sheet1").Cells(3, 2)`, `End With` – BigBen Jan 02 '22 at 18:14

0 Answers0