Copying Worksheets

Hannah

Board Regular
Joined
Aug 20, 2002
Messages
51
I want to copy a whole worksheet from a workbook that is not active into an active workbook, but i'm getting the error "subscript out of range" This is what i've done....any suggestions?

Workbooks("c:timesheetsexpenditureconsulting_tues.xls").Sheets(1).Copy _
after:=ActiveWorkbook.Sheets(2)
 
i figured that out as soon as i replied (always the way)....ended up doing:

Workbooks.Open "testing.xls"
Workbooks("testing.xls").Sheets(1).Copy _
after:=Workbooks("result.xls").Sheets(5)

thanks.....i probably would have been puzzling for another week without some fresh input!
 
Upvote 0

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Forum statistics

Threads
1,225,063
Messages
6,182,637
Members
453,128
Latest member
mike4slund

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top