Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default creating new workbook macro

Hi, I've looked for this but can't find it exactly.

I need a macro to :
copy 7 specific sheets from one workbook (not the whole book) to a new book
ask the user for a name
save the new book as that name

Thanks in advance
--
Linda M
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default creating new workbook macro


Worksheets(Array("Sheet1", "Sheet2","Sheet3",
"Sheet4","Sheet5","Sheet6","Sheet7")).Copy
ans = inputbox("Name the new workbook"
activeworkbook.SaveAs Filename:= "C:\myDir\" & ans & ".xls"

--
HTH

Bob Phillips

"LindaM" wrote in message
...
Hi, I've looked for this but can't find it exactly.

I need a macro to :
copy 7 specific sheets from one workbook (not the whole book) to a new

book
ask the user for a name
save the new book as that name

Thanks in advance
--
Linda M



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default creating new workbook macro

Thank you very much, Bob. Just what I wanted
--
Linda M


"Bob Phillips" wrote:


Worksheets(Array("Sheet1", "Sheet2","Sheet3",
"Sheet4","Sheet5","Sheet6","Sheet7")).Copy
ans = inputbox("Name the new workbook"
activeworkbook.SaveAs Filename:= "C:\myDir\" & ans & ".xls"

--
HTH

Bob Phillips

"LindaM" wrote in message
...
Hi, I've looked for this but can't find it exactly.

I need a macro to :
copy 7 specific sheets from one workbook (not the whole book) to a new

book
ask the user for a name
save the new book as that name

Thanks in advance
--
Linda M




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 430
Default creating new workbook macro

Bob:

Is there a Isgrouped property, or the like that you could
"Group the sheets (using either shift or control keys) to Copy?
My google search didn't turn up anything.

TIA,
Jim


"Bob Phillips" wrote in message
...

Worksheets(Array("Sheet1", "Sheet2","Sheet3",
"Sheet4","Sheet5","Sheet6","Sheet7")).Copy
ans = inputbox("Name the new workbook"
activeworkbook.SaveAs Filename:= "C:\myDir\" & ans & ".xls"

--
HTH

Bob Phillips

"LindaM" wrote in message
...
Hi, I've looked for this but can't find it exactly.

I need a macro to :
copy 7 specific sheets from one workbook (not the whole book) to a new

book
ask the user for a name
save the new book as that name

Thanks in advance
--
Linda M





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default creating new workbook macro


"Bob Phillips" wrote in message
...

Worksheets(Array("Sheet1", "Sheet2","Sheet3",
"Sheet4","Sheet5","Sheet6","Sheet7")).Copy
ans = inputbox("Name the new workbook"
activeworkbook.SaveAs Filename:= "C:\myDir\" & ans & ".xls"

--
HTH

Bob Phillips

"LindaM" wrote in message
...
Hi, I've looked for this but can't find it exactly.

I need a macro to :
copy 7 specific sheets from one workbook (not the whole book) to a new

book
ask the user for a name
save the new book as that name

Thanks in advance
--
Linda M




Thanks!!
Had resorted to repeatedly calling a sub-subroutine to process a subgroup of
sheets until encountering your much more elegant, logical, and faster "With
Worksheets(array(...))...End With" solution.





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
saving macro from workbook to Personal Macro Workbook KrispyData Excel Discussion (Misc queries) 1 March 25th 10 05:52 PM
Creating a workbook Mac Excel Discussion (Misc queries) 3 June 11th 08 02:45 AM
Creating a drop box in a workbook. Dave F Excel Discussion (Misc queries) 0 January 19th 07 08:14 PM
Creating a log in a workbook barry Excel Discussion (Misc queries) 1 July 5th 06 08:11 PM
Creating a new workbook. sungen99[_2_] Excel Programming 2 May 6th 04 08:40 PM


All times are GMT +1. The time now is 09:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"