+ Reply to Thread
Results 1 to 21 of 21

Copy and consoliate data from multiple sheets

  1. #1
    Registered User
    Join Date
    04-28-2014
    Location
    Trinidad
    MS-Off Ver
    Excel 2010
    Posts
    6

    Copy and consoliate data from multiple sheets

    Hi,

    First week at first job and first post so go easy!

    I have 12 sheets of data in a workbook, one sheet for each of the months of the year (named Jan, Feb etc.).

    The month sheets have the same number columns in the same order and with same name however the rows are variable.

    Goal is to copy data from each sheet in turn to the summary sheet appending as it goes to have one long list of data with no gaps.

    Any ideas on how to automate will be much appreciated.

    best regards
    CR
    Attached Files Attached Files
    Last edited by Coolrunner; 04-28-2014 at 01:52 PM. Reason: File added

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Copy and consoliate data from multiple sheets

    See the advice in the link below.

    http://www.excelforum.com/the-water-...-question.html
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Copy and consoliate data from multiple sheets

    Give this a try:
    Please Login or Register  to view this content.
    Edit:
    oeldere's suggestion is excellent. I wrote this code without testing as you did not provide a sample worksheet to test on.
    Last edited by alansidman; 04-28-2014 at 01:45 PM.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Registered User
    Join Date
    04-28-2014
    Location
    Trinidad
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Copy and consoliate data from multiple sheets

    Thanks Alan - that is excellent. One minor tweak, any ideas on how to specify the 12 month sheets in the code rather than the "<> summary" as the workbook will have other sheets in apart from the summary and twelve months which wont form part of the consolidation?

    but finally thanks again for the quick response!

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Copy and consoliate data from multiple sheets

    Try replacing these two lines

    Please Login or Register  to view this content.
    with
    Please Login or Register  to view this content.
    Then remove the End IF line of code

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Copy and consoliate data from multiple sheets

    In addition to the code in #5 of alansidman.

    For Each ws in Worksheets(Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"))

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Copy and consoliate data from multiple sheets

    @oeldere--
    Thanks for picking up the typo.

    Alan

  8. #8
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Copy and consoliate data from multiple sheets

    @alansidman

    seen it, done that.

  9. #9
    Registered User
    Join Date
    04-28-2014
    Location
    Trinidad
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Copy and consoliate data from multiple sheets

    Thanks for the help so far, last debug i am getting is on this line of the code:

    Please Login or Register  to view this content.
    The error report is: Method 'Range' of object' _Worksheet failed

    again appreciate the help and patience. Below is the full code.

    Please Login or Register  to view this content.

  10. #10
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Copy and consoliate data from multiple sheets

    In the line of code referenced, remove the ws. as it is redundant.

  11. #11
    Registered User
    Join Date
    04-28-2014
    Location
    Trinidad
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Copy and consoliate data from multiple sheets

    thanks Alan, the code error is gone however the summary sheet comes up blank. Any ideas?

  12. #12
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Copy and consoliate data from multiple sheets

    Try this slightly modified code (Un-tested)

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

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

    Re: Copy and consoliate data from multiple sheets

    It's not redundant since the code doesn't activate any sheets. You actually need more of them:
    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  14. #14
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Copy and consoliate data from multiple sheets

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  15. #15
    Registered User
    Join Date
    04-28-2014
    Location
    Trinidad
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Copy and consoliate data from multiple sheets

    Thanks all for the help, it is much appreciated...the digital equivalent of good deed!

  16. #16
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Copy and consoliate data from multiple sheets

    You're welcome. Thanks for the rep.

  17. #17
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Copy and consoliate data from multiple sheets

    You are welcome and thank you also for the rep.

  18. #18
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Copy and consoliate data from multiple sheets

    @Coolrunner: oops . Just realised the rep on this thread was negative

  19. #19
    Registered User
    Join Date
    04-28-2014
    Location
    Trinidad
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Copy and consoliate data from multiple sheets

    Oh cr@p it should have been positive! very positive! how do i change that?

    My apologies!

  20. #20
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Copy and consoliate data from multiple sheets

    I guessed that . Don't worry about it. I reported the post and asked if Admin could reverse it. In the meantime, zbor has done a balancing act for me ... so I'm not suffering any great hardship.

    Cheers, TMS

  21. #21
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Copy and consoliate data from multiple sheets

    @Coolrunner: you will no doubt be pleased to know, as I am, that the Administrator has fixed the negative rep. So, all in all, it's worked out well for me!

    Thanks again to Alan Sidman, zbor and Admin for sorting out the rep for me

+ 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. Search Data from Multiple Sheets and copy found data to new workbook
    By xenith1988 in forum Excel Programming / VBA / Macros
    Replies: 27
    Last Post: 06-26-2012, 12:58 PM
  2. Copy data from multiple sheets and paste into multiple as well
    By Bishonen in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-04-2012, 10:26 AM
  3. Copy data from multiple sheets
    By accountant. in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-04-2011, 07:28 AM
  4. Copy data from multiple sheets
    By kn427 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-08-2010, 03:05 PM
  5. Copy data from multiple sheets
    By bjohnsonac in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-27-2009, 07:34 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