+ Reply to Thread
Results 1 to 3 of 3

Consolidate feature using macro with differing numbers of sheets

  1. #1
    Registered User
    Join Date
    12-02-2020
    Location
    Salem, VA
    MS-Off Ver
    2019
    Posts
    10

    Consolidate feature using macro with differing numbers of sheets

    I'm using a macro to select all sheets in a workbook and am then using the Consolidate feature under the Data header to consolidate the data into a single sheet. The number of sheets varies though (could be 3 one day and 10 the next). Is there a way to select all sheets, regardless of the names of the sheets and regardless of the number of sheets in the workbook, and utilize the Consolidate feature? The code below is what I got when I recorded the macro (I don't need that specific range - I just selected a large enough range so I know all the data would be picked up)


    screenshotmacro.png

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: Consolidate feature using macro with differing numbers of sheets

    This assumes that you have a blank first sheet in the workbook with the macro, and that File.xlsx is open at the time. You can change any of those assumptions easily...

    Please Login or Register  to view this content.
    Last edited by Bernie Deitrick; 12-08-2020 at 12:20 PM.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    12-02-2020
    Location
    Salem, VA
    MS-Off Ver
    2019
    Posts
    10

    Re: Consolidate feature using macro with differing numbers of sheets

    That seems to have worked perfectly! Thank you so much!
    Last edited by kariw; 12-08-2020 at 02:35 PM.

+ 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. Macro to consolidate from 2 Sheets to a Result Sheet
    By prkhan56 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-11-2017, 05:59 AM
  2. macro to consolidate sheets
    By excelhelpseeker in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-11-2016, 05:07 PM
  3. [SOLVED] Macro to Consolidate Staff Sheets by Months
    By prkhan56 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 05-03-2016, 02:34 PM
  4. [SOLVED] Macro to consolidate the excel sheets
    By akhileshgs in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-03-2013, 02:28 AM
  5. [SOLVED] consolidate over 50 sheets by Macro
    By Khoshravan in forum Excel General
    Replies: 7
    Last Post: 07-29-2006, 09:30 AM
  6. Sorting numbers with differing numbers of digits
    By Trudy in forum Excel General
    Replies: 5
    Last Post: 03-04-2006, 08:35 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