Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Select Worksheets, Copy to New Workbook
I have a worksheet that is used as a processing template and then I want to
copy specified worksheets to a new file for distribution without any macros attached. However, the code I'm using isn't working despite it being used successfully by other posters here. Obviously, I'm doing something wrong and would appreciate a pointer or two. This works fine: Sheets("NOTES").Select Sheets("NOTES").Copy These produce the error "Run-time error '1004' Select method of Sheets class failed": Attempt 1 Dim wkshts As Variant wkshts = Array("Summary", "Deployment Profiles", "Tranche G", "Tx DSMP", _ "T4 BHFS Deployments", "Tx Non-DSMP", "DSMP Adhoc", "Other Adhoc", _ "Incident Profile", "Outstanding Incidents", "Problem Records", "Master Incidents", _ "Deployment Cancellations", "Terminology", "DL", "Calculations") Sheets(wkshts).Select Sheets(wkshts).Copy Attempt 2 'Sheets(Array("NOTES", "Summary", "Deployment Profiles", "Tranche G", "Tx DSMP", _ "T4 BHFS Deployments", "Tx Non-DSMP", "DSMP Adhoc", "Other Adhoc", _ "Incident Profile", "Outstanding Incidents", "Problem Records", "Master Incidents" _ , "Deployment Cancellations", "Terminology", "DL", "Calculations")).Select 'Sheets(Array("NOTES", "Summary", "Deployment Profiles", "Tranche G", "Tx DSMP", _ "T4 BHFS Deployments", "Tx Non-DSMP", "DSMP Adhoc", "Other Adhoc", _ "Incident Profile", "Outstanding Incidents", "Problem Records", "Master Incidents" _ , "Deployment Cancellations", "Terminology", "DL", "Calculations")).Copy I'm guessing Sheets doesn't like Array very much but as the former was posted a while ago as an accepted solution to a problem and the latter was what the macro recorder gave me, I'm a little confused and at a loss as to what to do. All suggestions gratefully received! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Select Worksheets, Copy to New Workbook
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to select all worksheets in a workbook | Excel Discussion (Misc queries) | |||
Protecting select group of worksheets within a workbook | Excel Worksheet Functions | |||
Open Workbook Read Only and hide select worksheets | Excel Programming | |||
select all worksheets in a workbook | Excel Programming | |||
Select a range and copy to new workbook | Excel Programming |