PC Review


Reply
Thread Tools Rate Thread

copy tabs into new workbook, save, and close.

 
 
Tealina.Mairs@gmail.com
Guest
Posts: n/a
 
      19th Apr 2007
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!!

 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      19th Apr 2007
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



(E-Mail Removed) wrote:
>
> 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!!


--

Dave Peterson
 
Reply With Quote
 
Tealina.Mairs@gmail.com
Guest
Posts: n/a
 
      20th Apr 2007
On Apr 19, 9:28 am, Dave Peterson <peter...@verizonXSPAM.net> wrote:
> 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
>
>
>
>
>
> Tealina.Ma...@gmail.com wrote:
>
> > 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!!

>
> --
>
> Dave Peterson- Hide quoted text -
>
> - Show quoted text -


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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open New Workbook / Save and Close Current Workbook Joe K. Microsoft Excel Programming 1 7th Dec 2007 08:04 PM
copy selected tabs from multiple workbooks to a new workbook =?Utf-8?B?Y2hyaXM=?= Microsoft Excel Worksheet Functions 0 12th Jul 2007 03:46 PM
Copy & pasting formulas across workbook tabs =?Utf-8?B?QW5uZSBSZWljaGxlcg==?= Microsoft Excel Worksheet Functions 1 7th Jun 2007 09:25 PM
Select sheet tabs in workbook & save to separate workbook files =?Utf-8?B?c3RyYXRvY2FzdGVy?= Microsoft Excel Worksheet Functions 2 1st Mar 2006 03:35 PM
Help on Workbook close and workbook save events =?Utf-8?B?QWRhbSBIYXJkaW5n?= Microsoft Excel Programming 1 29th Sep 2005 04:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:57 PM.