+ Reply to Thread
Results 1 to 17 of 17

Consolidation of multiple worksheets into Master worksheet

  1. #1
    Forum Contributor
    Join Date
    02-04-2015
    Location
    India
    MS-Off Ver
    365 (2202)
    Posts
    226

    Consolidation of multiple worksheets into Master worksheet

    Hello Excel Experts,

    I've got below VBA code from some other forums which helps to consolidate my 3 worksheets into single (Master) worksheet.

    Please Login or Register  to view this content.
    But this code does not fulfills my overall requirement.

    This macro gives a MsgBox if there is already "Master" worksheet. I want this step to avoid.

    Instead I'll insert a "Master" worksheet for once and every time I run the macro, the data should get copied to this "Master" sheet. The data should also get copied in the same format, that is all the worksheets.
    Attached Files Attached Files
    Last edited by E5254730; 09-11-2020 at 11:12 AM.

  2. #2
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Consolidation of multiple worksheets into Master worksheet

    Hi E5254730,

    How about this ?
    Please Login or Register  to view this content.
    Last edited by nankw83; 09-11-2020 at 11:48 AM. Reason: Edited code to copy formatting as well ...
    If I was able to help, you can thank me by clicking the * Add Reputation under my user name

  3. #3
    Forum Contributor
    Join Date
    02-04-2015
    Location
    India
    MS-Off Ver
    365 (2202)
    Posts
    226

    Re: Consolidation of multiple worksheets into Master worksheet

    Hi,

    Apologize, if I was not so clear in my actual requirement.

    The provided code, copies the data again and again.

    For e.g. I have 3 tabs i.e. Project 1, Project 2, Project 3 and Project 4. I want data to get copied from Project 1, Project 2 and Project 3 only to Master tab.

    In each tab there are 100 records, so once we run the macro, 300 records should be in Master tab. But when I rerun the macro again 300 records gets copied, which means duplication of records.

    The headers are also not copied to master tab. Copy method should be same in Master worksheet as in the Project tabs.

  4. #4
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Consolidation of multiple worksheets into Master worksheet

    Ok, added another line to delete data when re-running the code ...

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    02-04-2015
    Location
    India
    MS-Off Ver
    365 (2202)
    Posts
    226

    Re: Consolidation of multiple worksheets into Master worksheet

    Getting debug msg as : Run time error 9: Subscript out of range

  6. #6
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Consolidation of multiple worksheets into Master worksheet

    I am not able to get the error At which line this error appears ?

  7. #7
    Forum Contributor
    Join Date
    02-04-2015
    Location
    India
    MS-Off Ver
    365 (2202)
    Posts
    226

    Re: Consolidation of multiple worksheets into Master worksheet

    Please Login or Register  to view this content.

  8. #8
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Consolidation of multiple worksheets into Master worksheet

    Did the code in post #2 work with you ?

  9. #9
    Forum Contributor
    Join Date
    02-04-2015
    Location
    India
    MS-Off Ver
    365 (2202)
    Posts
    226

    Re: Consolidation of multiple worksheets into Master worksheet

    i've answered that in post #3

  10. #10
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Consolidation of multiple worksheets into Master worksheet

    Possibly...
    Please Login or Register  to view this content.

  11. #11
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Consolidation of multiple worksheets into Master worksheet

    I just wanted to confirm, the reason is that added line of deleting the data of sheet "Master" has nothing to do with the line you're getting error at unless you have made some other changes to the file.

    Edit : Did you change the table to range in any of the sheets ?

  12. #12
    Forum Contributor
    Join Date
    02-04-2015
    Location
    India
    MS-Off Ver
    365 (2202)
    Posts
    226

    Re: Consolidation of multiple worksheets into Master worksheet

    Thank You! the above code looks to be working ok.

    I'll respond back if I still come across any issues.

    Thanks once again for fixing this.

  13. #13
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Consolidation of multiple worksheets into Master worksheet

    Glad to help & thanks for the added Rep. Please take a moment to mark this thread as [SOLVED] from the Thread Tools above your first post. In case you run into other issues, you can change the status again

  14. #14
    Forum Contributor
    Join Date
    02-04-2015
    Location
    India
    MS-Off Ver
    365 (2202)
    Posts
    226

    Re: Consolidation of multiple worksheets into Master worksheet

    Sorry to bother you again, but my overall requirement is not yet fulfilled.

    As said the last code provided by you merges all the available worksheets into Master worksheet. But I want only specific sheets to get copied to Master sheet.

    In below image, I've showed the worksheets available in my workbook. I only want Project 1, Project 2, and Project 3 sheets to get copied to Master sheet.

    Attachment 695123

    And when I run the last code provided by you, it copies all worksheets to Master sheet. It also copies data from the Pivot sheet to Master, which is not required.

    Lastly when the data gets copied to Master sheet, the Pivot sheet should not get affected, but to get auto refreshed.

    Note : In Run_Macro tab I've placed a button to run the macro.

  15. #15
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Consolidation of multiple worksheets into Master worksheet

    @E5254730, are you referring to my code in post # 4 or to dangelor's code in post # 10 ?

  16. #16
    Forum Contributor
    Join Date
    02-04-2015
    Location
    India
    MS-Off Ver
    365 (2202)
    Posts
    226

    Re: Consolidation of multiple worksheets into Master worksheet

    Post #4 - gives me error at below line, so i was referring the code posted in post #10
    Please Login or Register  to view this content.
    please note, my data is table format in all the sheets.

  17. #17
    Forum Contributor
    Join Date
    02-04-2015
    Location
    India
    MS-Off Ver
    365 (2202)
    Posts
    226

    Re: Consolidation of multiple worksheets into Master worksheet

    Hi,

    I've below code which copies specific tabs to the Master sheet, but I want only once the headers should appear in Master sheet. Now when the run the macro, I'm getting repeated headers.

    In attached you can see the headers are repeated on Row 702 and Row 1403.

    HTML Code: 
    Attached Files Attached Files

+ 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. Replies: 0
    Last Post: 03-03-2016, 10:18 AM
  2. Consolidation of multiple worksheet into a master excel worksheet
    By Ravipoojari in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-30-2015, 04:38 AM
  3. Accumulating data from multiple worksheets into a master worksheet
    By niteshmaherchandani in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-04-2013, 06:04 AM
  4. Replies: 1
    Last Post: 09-25-2013, 12:18 PM
  5. [SOLVED] Subtract multiple quantities sold from multiple worksheets from master inventory worksheet
    By grammydeb52 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-01-2013, 03:01 AM
  6. Copy multiple worksheets into a master worksheet
    By shabbir2812 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-10-2013, 01:31 PM
  7. Auto update master worksheet from multiple worksheets
    By momossy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-10-2010, 05:18 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