LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Create new workbook, temporarily name it and copy sheets to it

My VBA is basic to say the least however I am learning from my mistakes
pretty quick! :o)

I'm trying to copy some sheets from an existing workbook to a new workbook
in their entirety i.e. page breaks, colours etc.

The error occurs as I do not know how to rename the newly opened workbook
and it comes unstuck when it refers back to Book1 or Book2 or Book3 etc.

I've looked at previous questions on this topic and am a little confused so
would appreciate some clarity...

Below is an extract from the macro if it helps

Many thanks in advance

Jim


Workbooks.Add
Windows.CompareSideBySideWith "EXISTING NAMED WORKBOOK.xls"
Windows("EXISTING NAMED WORKBOOK.xls").Activate
Sheets("Existing Data").Select
Sheets("Existing Data").Copy After:=Workbooks("Book2").Sheets(3)
Windows("EXISTING NAMED WORKBOOK.xls").Activate
Sheets("4. All Sales Execs Report").Select
Sheets("4. All Sales Execs Report").Copy
Befo=Workbooks("Book2").Sheets(4)
Windows("EXISTING NAMED WORKBOOK.xls").Activate
Sheets("3. Sales Exec Report").Select
Sheets("3. Sales Exec Report").Copy Befo=Workbooks("Book2").Sheets(4)
Windows("EXISTING NAMED WORKBOOK.xls").Activate

 
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
Macro to create new workbook and sheets Richard Excel Discussion (Misc queries) 1 July 31st 07 07:31 PM
Multiple Sheets (Need to create 500 individual sheets in one workbook, pulling DATA Amaxwell Excel Worksheet Functions 4 August 17th 06 06:23 AM
create workbook, copy sheets Pierre via OfficeKB.com[_2_] Excel Programming 0 October 25th 05 07:51 AM
Create New Workbook - Name book - 4 Sheets - Name Sheets Greg[_21_] Excel Programming 6 June 12th 05 04:41 AM
VBA to create an Array of all Sheets in workbook Guy Hoffman[_3_] Excel Programming 3 January 13th 04 03:50 AM


All times are GMT +1. The time now is 08:23 AM.

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"