Consulting

Results 1 to 9 of 9

Thread: VBA to merge specific sheet of different workbooks into one multisheet master file

  1. #1

    VBA to merge specific sheet of different workbooks into one multisheet master file

    I have multiple workbooks as individual office KPIs with first sheet as linked to other sheets in that workbook. There are 42 of these workbooks. I now want to create a master file with only Sheet 1 of all 42 workbooks that i place under under one folder. The master file will have individual sheets with Sheet 1 of each of these 42 workbooks. Can someone please help. Also, all 42 are macro enabled workbooks, will that cause any issue?

  2. #2
    Have you tried Data, New Query (or Get Data), From File, From Folder ?
    Regards,

    Jan Karel Pieterse
    Excel MVP jkp-ads.com

  3. #3
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,642
    You might use:

    Sub M_snb()
      for j=1 to 42
         thisworkbook.sheets.add ,thisworkbook.sheets(thisworkbook.sheets.count),,"G:\OF\example" & j & ".xlsm"
      next
    End Sub

  4. #4
    Where should I post this. I have 42 workbooks each with may be N number of sheet, but I only want to copy first sheet from each of these 42 workbooks.


    Quote Originally Posted by snb View Post
    You might use:

    Sub M_snb()
      for j=1 to 42
         thisworkbook.sheets.add ,thisworkbook.sheets(thisworkbook.sheets.count),,"G:\OF\example" & j & ".xlsm"
      next
    End Sub

  5. #5
    Yes I did but as the sourced files are VBA enabled, this didnt work.

  6. #6
    Not sure what the fact that they are vba enabled has to do with our suggestions?
    Regards,

    Jan Karel Pieterse
    Excel MVP jkp-ads.com

  7. #7
    Hey Jan.

    This code didnt work for me. I mean the files are VBA and has linked pages

    Quote Originally Posted by Jan Karel Pieterse View Post
    Have you tried Data, New Query (or Get Data), From File, From Folder ?

  8. #8
    Regardless of VBA or links, the Power Query route should work.
    Regards,

    Jan Karel Pieterse
    Excel MVP jkp-ads.com

  9. #9

    Combine specific sheets from multiple workbooks into 1 workbook.

    I'm looking for something similar to this.

    I have several similar workbooks. I want to copy specific worksheets from each workbook and paste into 1 workbook. tab names can be the same with just a # on the end.

Posting Permissions

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