+ Reply to Thread
Results 1 to 6 of 6

Merging Two (or more) Workbooks

  1. #1
    Chaplain Doug
    Guest

    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. #2
    Tom Ogilvy
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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. #3
    Chaplain Doug
    Guest

    Re: 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" <[email protected]> wrote in message
    > news:[email protected]...
    > > 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. #4
    Lonnie M.
    Guest

    Re: 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. #5
    Lonnie M.
    Guest

    Re: 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. #6
    Tom Ogilvy
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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" <[email protected]> wrote in

    message
    > > news:[email protected]...
    > > > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1