I am trying to write a macro that takes parts of one sheet and paste values on the next. I know using select isn't ideal. But i Don't know how to do it other wise. In the past i have got a out of range error if i was not selecting the sheet before hand. In the macro i have y defined earlier but I am getting an
1004 application-defined or object-defined error
y = Sheets("sheet1").Range("B1", Range("B2").End(xlDown)).Count Sheets("Bucket12").Select Sheets("Bucket12").Range("C2", Range("C2").End(xlDown)).Copy Sheets("upload").Range(Cells(y, 2)).PasteSpecial xlPasteValues Sheets("Bucket12").Range("E2", Range("E2").End(xlDown)).Copy Sheets("upload").Range(Cells(y, 3)).PasteSpecial xlPasteValues Sheets("Bucket12").Range("G2", Range("G2").End(xlDown)).Copy Sheets("upload").Range(Cells(y, 5)).PasteSpecial xlPasteValues Application.CutCopyMode = False
Bucket12andupload?Bucket12selected thenCells(y,3)is using that and notupload. The two ranges are on different sheets so will throw an error.