+ Reply to Thread
Results 1 to 6 of 6

Combine specified worksheets different workbooks with same data

  1. #1
    Registered User
    Join Date
    12-05-2012
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2003
    Posts
    16

    Combine specified worksheets different workbooks with same data

    Hi,

    I required too combine specified worksheets from different workbooks, and only from a certain sheet within the workbooks (the sheets are called the same thing if this helps or not).

    Does anyone know a marco which make this possible? I can combine worksheets from the same workbook just not different workbooks.

    Thanks

    Arron
    Last edited by arrongraham; 09-04-2013 at 04:06 AM.

  2. #2
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Combine different workbooks with same data

    Post the working code that you current have? And how do you want to choose the "other" workbook(s)? A file selection dialog? or prefixed file name?

  3. #3
    Registered User
    Join Date
    12-05-2012
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Combine different workbooks with same data

    I have just reallised that I have been confusing workbooks with worksheets. What I require is to combine worksheets from different workbooks.

    The other workbooks will always remain the same so can it be built into the code? The code bellow will combine specified worksheets within the same workbook. Can it be altered to combine sheets from separt workbooks. If it helps the sheets are called the same thing.

    Please Login or Register  to view this content.

  4. #4
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Combine different workbooks with same data

    Try this:
    Please Login or Register  to view this content.
    You can move that chunk to a whole new Sub instead if you want, but remember the Dim's

  5. #5
    Registered User
    Join Date
    12-05-2012
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Combine different workbooks with same data

    I get an error at the 'For Each ws In Sheets(Array("S1", "S2"))' line.

    Say I have books called test1, test2 and test3 which are too be copied from and into book called Master.

    From the test1, test2 and test3 books I requires too combine sheets called comb on all the sheets into sheet called the same thing on the Master book.

    does this make sense?

  6. #6
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Combine specified worksheets different workbooks with same data

    So open the Master workbook, and leave everything else closed. Change Workbooks.Open("C:\....\filename.xlsx") to one of the other books, test1, or test2, etc. Now run the code on Master, do you still get any error?

    if yes, try changing For Each ws In Sheets(Array("S1", "S2")) to
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Combine data from 4 workbooks and then export filtered data to individual files?
    By womanket in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-16-2013, 12:20 PM
  2. combine workbooks and data
    By jmatthews in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-10-2012, 03:46 PM
  3. [SOLVED] Index and Match to Combine Data from Several Workbooks
    By IrrepressibleXL in forum Excel General
    Replies: 5
    Last Post: 03-28-2012, 06:03 PM
  4. Combine Data from different workbooks
    By zplugger in forum Excel Programming / VBA / Macros
    Replies: 33
    Last Post: 04-22-2009, 03:17 AM
  5. [SOLVED] Compare two Workbooks and combine data into one workbook
    By SBonner in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-12-2006, 08:25 PM

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