+ Reply to Thread
Results 1 to 12 of 12

Gathering data from multiple worksheets and compiling it into one

  1. #1
    Registered User
    Join Date
    11-29-2010
    Location
    Milwaukee, WI
    MS-Off Ver
    Excel 2003
    Posts
    19

    Gathering data from multiple worksheets and compiling it into one

    Hello,
    As a heads up I have some experience with Excel and virtually none with VBA.

    I have 6 worksheets named Mon,Tues,Wed,Thurs,Fri,and Sat. I need to copy a range of data from each worksheet and compile it into a final worksheet named "DTTracker". The amount of data input into the days worksheets varies from day to day (one day there could be 15 rows of data and another day only 2), but I need to it compile one on top of the other in DTTracker. Any help is greatly appreciated.
    Last edited by bjvick; 12-03-2010 at 10:19 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Gathering data from multiple worksheets and compiling it into one

    This assumes the DTTracker already has the headers in row 1 that you need.
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    11-29-2010
    Location
    Milwaukee, WI
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Gathering data from multiple worksheets and compiling it into one

    I'm getting a "subscript out of range" error for this line:

    For Each wsDay In Sheets(Array("Mon", "Tues", "Wed", "Thurs", "Fri", "Sat"))

    Also, I should have mentioned before that the data doesn't start until Cell B10 in each days wkst.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Gathering data from multiple worksheets and compiling it into one

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Gathering data from multiple worksheets and compiling it into one

    A subscript out of range error usually means spelling errors. Check the example array I showed you against your actual worksheet and make sure all the sheetnames are spelled accurately. Look for hidden spaces.

    My code shows how to copy from A2, you can certainly fiddle with that to change it to B10, no?

  6. #6
    Registered User
    Join Date
    11-29-2010
    Location
    Milwaukee, WI
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Gathering data from multiple worksheets and compiling it into one

    Here's what it looks like
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    11-29-2010
    Location
    Milwaukee, WI
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Gathering data from multiple worksheets and compiling it into one

    It was indeed a hidden space. Its working now but pasting over itself every time I believe as Sat. is the only info that shows up in DTTracker

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Gathering data from multiple worksheets and compiling it into one

    Try this slight amendment
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    11-29-2010
    Location
    Milwaukee, WI
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Gathering data from multiple worksheets and compiling it into one

    Thanks, the code runs but only shows Sat. in DT tracker worksheet. I think each day is pasting over the previous. Ideas?
    Last edited by bjvick; 11-30-2010 at 12:12 PM.

  10. #10
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Gathering data from multiple worksheets and compiling it into one

    1) Why is column A empty on every sheet? Data sheets should not be "designed" in funky ways. It's data. Start at at the top, fill in data, then create reports from the data on your report sheets.

    2) Like so:

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by JBeaucaire; 11-30-2010 at 12:51 PM.

  11. #11
    Registered User
    Join Date
    11-29-2010
    Location
    Milwaukee, WI
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Gathering data from multiple worksheets and compiling it into one

    Thank you very much it works perfectly now.

  12. #12
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Gathering data from multiple worksheets and compiling it into one

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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