copy tabs into new workbook, save, and close.

T

Tealina.Mairs

Good morning!

I'm trying to copy tabs from a current workbook, into a new file,
saving that file, closing it, then returning to the original file -
but my code seems to stop right after copying the tabs into a new
workbook. If someone could tell me what I'm doing wrong, that would
be really appreciated! I would love to have the user prompted to name
the file when they save it - but I'm not sure how to do it.

Sheets(Array("Tables", "Cashflows", "Calc Sheet", _
"Metrics", "REA", "Inputs")).Select
Sheets("Tables").Activate
Sheets(Array("Tables", "Cashflows", "Calc Sheet", _
"Metrics", "REA", "Inputs")).Copy
Sheets("REA").Range("E1").Select
** It ends right here **
Sheets(Array("Tables", "Calc Sheet")).Select
ActiveWorkbook.Save
ActiveWorkbook.Close savechanges:=True
Sheets("Menu").Select

Thank you!!
 
D

Dave Peterson

You can only select a range if the sheet is active. So how about trying:

Sheets(Array("Tables", "Cashflows", "Calc Sheet", _
"Metrics", "REA", "Inputs")).Copy

Sheets("REA").select
sheets("Rea").Range("E1").Select

Sheets(Array("Tables", "Calc Sheet")).Select

'show the file|SaveAs dialog
application.dialogs(xldialogsaveAs).show
 
T

Tealina.Mairs

You can only select a range if the sheet is active. So how about trying:

Sheets(Array("Tables", "Cashflows", "Calc Sheet", _
"Metrics", "REA", "Inputs")).Copy

Sheets("REA").select
sheets("Rea").Range("E1").Select

Sheets(Array("Tables", "Calc Sheet")).Select

'show the file|SaveAs dialog
application.dialogs(xldialogsaveAs).show










--

Dave Peterson- Hide quoted text -

- Show quoted text -

Thank you sooooo much! It worked perfectly - I really appreciate it!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top