Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 127
Default Merging Two (or more) Workbooks

Excel 2002-2003. How do I programmatically merge two or more workbooks. How
do I manually merge two or more workbooks. Thanks for any help.
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Merging Two (or more) Workbooks

copy and paste. Select all the sheets in one workbook and do Move or copy
Sheet in the Edit menu. Select a destination in the dropdown and if you
want to copy , click the copy checkmark

With Workbooks("NewBook.xls")
activeworkbook.Sheets.Copy After:=.Sheets(Sheets.count)
End With

--
Regards,
Tom Ogilvy

"Chaplain Doug" wrote in message
...
Excel 2002-2003. How do I programmatically merge two or more workbooks.

How
do I manually merge two or more workbooks. Thanks for any help.
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 127
Default Merging Two (or more) Workbooks

Sorry Tom. May I ask for more detail?

If I have book1 and book2 and I want to merge them into book3, what would
the code look like? Thanks.

"Tom Ogilvy" wrote:

copy and paste. Select all the sheets in one workbook and do Move or copy
Sheet in the Edit menu. Select a destination in the dropdown and if you
want to copy , click the copy checkmark

With Workbooks("NewBook.xls")
activeworkbook.Sheets.Copy After:=.Sheets(Sheets.count)
End With

--
Regards,
Tom Ogilvy

"Chaplain Doug" wrote in message
...
Excel 2002-2003. How do I programmatically merge two or more workbooks.

How
do I manually merge two or more workbooks. Thanks for any help.
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Merging Two (or more) Workbooks

Doug, give this a try. You may want to create a loop for each sheet in
the workbook.

For Each WS In ActiveWorkbook.Worksheets
WS.Select
ActiveWindow.SelectedSheets.Copy
After:=Workbooks("Book3.xls").Sheets(Sheets.Count)
End If
Next

HTH--Lonnie

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Merging Two (or more) Workbooks

Oops, forgot to take out the end if. I might as well tweak it too.

For Each WS In Workooks("Book1.xls")
WS.Select
ActiveWindow.SelectedSheets.Copy _
After:=Workbooks("Book3.xls").Sheets(Sheets.Count)
Next

Sorry about that--Lonnie M.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Merging Two (or more) Workbooks

With Workbooks("Book3.xls")
workbooks("Book1.xls").sheets.copy After:=.Sheets(.Sheets.count)
workbooks("Book2.xls").sheets.copy After:=.Sheets(.Sheets.count)
End with

--
Regards,
Tom Ogilvy

"Chaplain Doug" wrote in message
...
Sorry Tom. May I ask for more detail?

If I have book1 and book2 and I want to merge them into book3, what would
the code look like? Thanks.

"Tom Ogilvy" wrote:

copy and paste. Select all the sheets in one workbook and do Move or

copy
Sheet in the Edit menu. Select a destination in the dropdown and if you
want to copy , click the copy checkmark

With Workbooks("NewBook.xls")
activeworkbook.Sheets.Copy After:=.Sheets(Sheets.count)
End With

--
Regards,
Tom Ogilvy

"Chaplain Doug" wrote in

message
...
Excel 2002-2003. How do I programmatically merge two or more

workbooks.
How
do I manually merge two or more workbooks. Thanks for any help.
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org






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
merging workbooks KRK New Users to Excel 3 December 6th 07 03:57 PM
Help merging workbooks Cris[_2_] Excel Discussion (Misc queries) 4 October 3rd 07 03:06 PM
Merging workbooks Autumn Excel Discussion (Misc queries) 1 April 10th 07 10:08 AM
Merging 3 workbooks when they are not exactly the same Karen Le Excel Worksheet Functions 1 June 17th 06 01:21 AM
merging workbooks Ria Excel Discussion (Misc queries) 2 July 23rd 05 01:35 PM


All times are GMT +1. The time now is 12:44 PM.

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

About Us

"It's about Microsoft Excel"