+ Reply to Thread
Results 1 to 9 of 9

Combining sheets from multiple workbooks into master

  1. #1
    Registered User
    Join Date
    07-17-2009
    Location
    Indianapolis, IN
    MS-Off Ver
    Excel 2003
    Posts
    10

    Combining sheets from multiple workbooks into master

    I promise I searched, and tried to modify some of the vbscript I found here on the site that did similar things, but have not been able to make this work.

    I have several workbooks that supervisors in a call center use to grade calls for quality.

    Each supervisor has a seperate workbook, and after scoring the call, the supervisor runs a vb script that copies all of the data from the worksheet "observation" onto "sheet1" for storing the data.

    So now I want to use another workbook to:

    1. Copy each sheet1 from all of the supervisor workbooks onto a sheet named "cumulative" in a different workbook.

    In a perfect world it would also:
    2. Keep a count of how many observations were done by each supervisor each day
    3. Keep a count of how many have been done week to date
    4. Keep a count how many have been done total since January 1, 2009

    Each workbook is kept on a network drive at s:\supervisors\qadata and named - for example QAformMelissa.xls

    I'm okay with keeping the master sheet in the same directory if that makes it easier to accomplish this.

    I've attached a scorecard workbook and the "master sheet" if that is helpful.
    the scorecard is "fake" because the actual was larger than allowed by the forum, but hopefully you will be able to see what I'm doing.

    Thanks much for taking the time to read and consider.
    Attached Files Attached Files
    Last edited by jaikin; 09-17-2009 at 12:06 PM.

  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: Combining sheets from multiple workbooks into master

    Question: After the QAForm???.xls is opened and imported, is the data on Sheet1 to be cleaned out so the next time you run the program it will not import the same data again?

    Or does the manager clear it out?

    Or should we add a field to the QAForm???.xls where we can mark each row as having been imported? Perhaps in column BD? This way each time it is run we only import rows with nothing in column BD.
    _________________
    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
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Combining sheets from multiple workbooks into master

    Item 1:
    Assuming the data in the manager's sheets does not get cleared out, then this macro will add and maintain the status of each row (imported or not) in column BD. It will import each sheet sequentially to the Cumulative database.

    Please Login or Register  to view this content.
    ITEMS 2-4:

    List the supervisors in column A. Then insert and copy down the following formulas:

    In B2:
    =SUMPRODUCT(--(Cumulative!$B$2:$B$20000=$A2),--(INT(Cumulative!$C$2:$C$20000)=TODAY()-1))

    In C2: (assuming Monday is the first day of the week)
    =SUMPRODUCT(--(Cumulative!$B$2:$B$20000=$A2),--(Cumulative!$C$2:$C$20000>=TODAY()-MOD(TODAY()-2,7)))

    In D2:
    =SUMPRODUCT(--(Cumulative!$B$2:$B$20000=$A2),--(YEAR(Cumulative!$C$2:$C$20000)=YEAR(TODAY())))
    Attached Files Attached Files
    Last edited by JBeaucaire; 09-17-2009 at 11:13 AM.

  4. #4
    Registered User
    Join Date
    07-17-2009
    Location
    Indianapolis, IN
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Combining sheets from multiple workbooks into master

    Thank you that worked beautifully.

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

    Re: Combining sheets from multiple workbooks into master

    This has been covered many times, you should try using the Forum Search engine e.g

    http://www.excelforum.com/excel-prog...-into-one.html
    Hope that helps.

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

    Free DataBaseForm example

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

    Re: Combining sheets from multiple workbooks into master

    Quote Originally Posted by jaikin View Post
    Thank you that worked beautifully.
    Excellent. Now analyze what we did in this script and compare it to what you were trying to do in amending other scripts. Of course there are 100s of ways to do the same thing, but by examining them in detail you can possibly learn what was wrong with your attempts.

    Also, next time, post up the code you're working on so we can see where you're at so far, that might help us point out corrections to your own method more directly and speed up the learning curve for you, too.

    ======
    If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].


    (Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated)

  7. #7
    Registered User
    Join Date
    07-17-2009
    Location
    Indianapolis, IN
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Combining sheets from multiple workbooks into master

    I appreciate the tips, and in the future I'll post my attempts.

    thanks again.

  8. #8
    Registered User
    Join Date
    03-24-2008
    Location
    Calabar, Nigeria
    MS-Off Ver
    2003, 2007
    Posts
    37

    Re: Combining sheets from multiple workbooks into master

    I spent 2 days on the attached solution only to be back to this thread to find it SOLVED. I m still attaching it as an alternative solution. I hope the forum rules allow that. The solution assumes that all the files including the master are in one folder. Opening the master workbook fills the list automatically and summarizes the counts.
    Attached Files Attached Files
    Last edited by nsenor udofa; 09-20-2009 at 08:51 AM.

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

    Re: Combining sheets from multiple workbooks into master

    There's no rule against it, though posts after "solved" should, in my opinion, be added because the you sincerely believe the additional solution represents a better (read that as simpler or more accurate for some reason).

    After reading through yours, it is definitely not simpler and the accuracy could only be equaleed.

+ 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