+ Reply to Thread
Results 1 to 5 of 5

VBA to consolidate multiple worksheets into one

  1. #1
    Registered User
    Join Date
    10-13-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2013
    Posts
    52

    VBA to consolidate multiple worksheets into one

    hi all gurus,

    Needing a vba code that consolidates multiple worksheets into one single sheet. key dot points as below:

    1. only selected sheets to be consolidated (in the attached file, only sheets with numbered names to be consolidated)
    2. No. of columns in each numbered sheet remains the same, but rows can change
    3. only contents below the row headings to be consolidated.
    4. data to be consolidated in the "Table" Sheet

    Any help would be greatly appreciated.

    Thank you.
    S
    Attached Files Attached Files

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: VBA to consolidate multiple worksheets into one

    Are the blank columns in-between your data columns house formula's or are these just blank cells?
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: VBA to consolidate multiple worksheets into one

    Hi shrijan,

    See the following code which is included in the attached file. There are 2 Yellow CommandButton Shapes on Sheet 'Table':
    a. Clear the Data Area on Sheet 'Table'
    b. Put Data from the Numbered Sheets into Sheet 'Table'

    In ordinary code module ModConsolidateData:
    Please Login or Register  to view this content.
    It is a best practice to declare all variables. If you misspell a variable in your code, VBA will silently assume it is a Variant variable and go on executing with no clue to you that you have a bug. Go to the VBA development window, click Tools, Options, and check "Require Variable Declaration." This will insert the following line at the top of all new modules:
    Please Login or Register  to view this content.
    This option requires all variables to be declared and will give a compiler error for undeclared variables.

    To access Visual Basic (VBA) see:
    http://www.ablebits.com/office-addin...a-macro-excel/
    a. Click on any cell in the Excel Spreadsheet (may not be needed).
    b. ALT-F11 to get to VBA.
    c. CTRL-R to get project explorer (if it isn't already showing).
    d. Double Click on a 'Module Name' in 'Project Explorer' to see code for that module.

    Lewis

  4. #4
    Registered User
    Join Date
    10-13-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2013
    Posts
    52

    Re: VBA to consolidate multiple worksheets into one

    Hi Mike,

    They are just black columns

    S

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: VBA to consolidate multiple worksheets into one

    Try
    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. Consolidate multiple worksheets into one
    By raeray38501 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 08-21-2014, 10:21 AM
  2. [SOLVED] Consolidate all data in multiple worksheets of multiple workbooks in one Master file.
    By adil.master in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-23-2014, 09:59 PM
  3. consolidate multiple worksheets
    By Mbutler132000 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-26-2010, 06:10 AM
  4. Consolidate Multiple Worksheets
    By DGA2008 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-09-2009, 09:03 AM
  5. Consolidate Multiple Worksheets Into One
    By DGA2008 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-29-2009, 05:49 PM
  6. [SOLVED] Consolidate multiple worksheets in a workbook into one
    By Staci in forum Excel General
    Replies: 0
    Last Post: 06-19-2006, 02:10 PM
  7. [SOLVED] How to consolidate data from multiple worksheets.
    By SAR in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM

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