0
votes

I am trying to copy a range of cells from one worksheet (Sheet2) to a different range of cells in another worksheet (Sheet1) but when I run the below, I get a run time error (1004) application defined or object defined error. Any help is appreciated!

Option Explicit

Sub deletecolumns()

Workbooks(1).Worksheets(1).Columns(2).Select
Workbooks(1).Worksheets(1).Columns(2).Delete


Sheets("Sheet2").Range("I4:I29").Copy Destination:=Sheets("Sheet1").Range("H4:H29")

End Sub
1

1 Answers

1
votes

delete this line:

Workbooks(1).Worksheets(1).Columns(2).Select

there's no need for it before doing a .delete anyway