+ Reply to Thread
Results 1 to 14 of 14

Consolidate multiple worksheets into one

  1. #1
    Registered User
    Join Date
    10-16-2013
    Location
    Cookeville, TN
    MS-Off Ver
    Excel 2007
    Posts
    8

    Consolidate multiple worksheets into one

    Hi gurus,
    I am sure this has been done before and I just can't find it. I have a workbook that has several sheets in it with various rows of data on each sheet. I would like to have a macro to loop through all the sheets in the workbook and copy and paste the rows into a new summary sheet. The rows to be copied should only have data in Column A, in other words if Column A of a row is blank I want it skipped. Also Row 1 of every sheet contains my headers, and I am only using columns A through M. It needs to be able to copy rows even when autofilter is in use.

    Thanks,
    Rachael

  2. #2
    Registered User
    Join Date
    08-19-2014
    Location
    Pittsburgh, Pennsylvania
    MS-Off Ver
    2010
    Posts
    45

    Re: Consolidate multiple worksheets into one

    Like this?

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-25-2013
    Location
    england
    MS-Off Ver
    2010
    Posts
    29

    Re: Consolidate multiple worksheets into one

    hi how would this code be changed to copy more than one column say column A through to column M and rows 1 to say 200.

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Consolidate multiple worksheets into one

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    Remember what the dormouse said
    Feed your head

  5. #5
    Registered User
    Join Date
    10-16-2013
    Location
    Cookeville, TN
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Consolidate multiple worksheets into one

    Sorry Jaime that didn't work, it still copies some of the rows where column A is empty. Would it matter if my data is arranged as tables?

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Consolidate multiple worksheets into one

    Maybe:

    Please Login or Register  to view this content.
    Last edited by JOHN H. DAVIS; 08-20-2014 at 10:27 AM.

  7. #7
    Registered User
    Join Date
    08-19-2014
    Location
    Pittsburgh, Pennsylvania
    MS-Off Ver
    2010
    Posts
    45

    Re: Consolidate multiple worksheets into one

    No, now that I look at this, I believe this loop will not function properly:
    Please Login or Register  to view this content.
    Once a row is deleted, the next row that the loop should hit would be the same as the prior row number.
    The way the loop works, if Row 2 had a blank cell in that column, that row would be deleted, and the entire table would shift up one row.
    The next row that the loop should hit should be Row 2 again to check the next item, make sense?

    I'll modify today when time allows.

  8. #8
    Registered User
    Join Date
    10-16-2013
    Location
    Cookeville, TN
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Consolidate multiple worksheets into one

    John,
    I get a compile error on yours. Looks like it is missing an "End If" statement but when I add that it says "For without Next"

  9. #9
    Registered User
    Join Date
    10-16-2013
    Location
    Cookeville, TN
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Consolidate multiple worksheets into one

    I found Ron de Bruin's code to merge, which works pretty well except I would like to modify it only take the rows that have values in column A.

    Please Login or Register  to view this content.

  10. #10
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Consolidate multiple worksheets into one

    Quote Originally Posted by raeray38501 View Post
    John,
    I get a compile error on yours. Looks like it is missing an "End If" statement but when I add that it says "For without Next"
    I caught the error and saved it. You probably looked at it before the changes.

  11. #11
    Registered User
    Join Date
    10-16-2013
    Location
    Cookeville, TN
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Consolidate multiple worksheets into one

    I'm sorry John,
    I am still getting an error. Compile error "Next without For"

  12. #12
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Consolidate multiple worksheets into one

    Oops.

    Please Login or Register  to view this content.
    One of those days.

  13. #13
    Registered User
    Join Date
    10-16-2013
    Location
    Cookeville, TN
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Consolidate multiple worksheets into one

    John,
    I am getting an error on another line now.

    "ws.Range(Cells(i, "A"), Cells(i, "M")).Copy Sheets("Summary").Range("A" & Rows.count).End(3)(2)"

    Thanks,
    Rachael

  14. #14
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Consolidate multiple worksheets into one

    What is the error? Did you create a Sheet "Summary".

+ 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. [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
  2. consolidate multiple worksheets
    By Mbutler132000 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-26-2010, 06:10 AM
  3. Consolidate Multiple Worksheets
    By DGA2008 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-09-2009, 09:03 AM
  4. Consolidate Multiple Worksheets Into One
    By DGA2008 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-29-2009, 05:49 PM
  5. 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