+ Reply to Thread
Results 1 to 7 of 7

Macro to reorganize and collect data from multiple workbooks

  1. #1
    Registered User
    Join Date
    09-18-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    3

    Macro to reorganize and collect data from multiple workbooks

    I'm sending out an excel file with a survey to 300+ individuals and was wondering if there was a way to reorganize and collect the data automatically.

    I've attached a sample workbook with an example survey.

    The data points are located at different sections of the survey and I was wondering if there was a way to automatically reorganize all the data in a single row (example is located in the example output worksheet) and collect it from several workbooks.

    The survey that was sent out only includes an instructions tab and the survey tab.

    Also not sure if its possible to collect the filled out survey worksheets and dump them into one workbook. I ask this because in the actual survey there's some additional fields that have lists of info that individuals can add but won't be comparable since they can potentially add an infinite number of things.
    Attached Files Attached Files

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to reorganize and collect data from multiple workbooks

    Hi bobfor1,

    You can do it if you allocate one or several rows per survey and you know the book names.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Macro to reorganize and collect data from multiple workbooks

    Hello bofor1,

    Create a "master" workbook that will hold the summary. Name one the sheets "Summary" and add the same headers to row 1 as in the example workbook. This macro will search the path "C:\Document and Settings\Owner\My Documents" for all Excel workbook files. Change this path to where your survey workbooks are stored. Each file will then be opened and the data from the "Survey" sheet will copied into the master"Summary" sheet. If you have any problems, let me know.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

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

    Re: Macro to reorganize and collect data from multiple workbooks

    This macro should do the "collecting" for you. The macro goes into the workbook with the sheet names "Example Output", or change the macro to match your actual summary sheet name.

    Also be sure to edit the macro so the fPATH points to the folder where all the surveys are. Make sure the Summary workbook you're creating is not in the same folder.
    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!)

  5. #5
    Registered User
    Join Date
    09-18-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Macro to reorganize and collect data from multiple workbooks

    Thanks for the replies!

    @Leith Ross - I seem to be running into some errors when I try using your code.

    When I created worksheet labeled "Summary" and copied the headers into row 1 and ran the macro, it gives me an error at the line
    Please Login or Register  to view this content.
    When I delete the header and ran the macro, it gives me a different error saying that the file could not be found and to check the spelling and file location and gives me an error at the line
    Please Login or Register  to view this content.

    @JBeaucaire - Looks like everything is working great! Thanks!


    Again appreciate the responses, thanks!

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Macro to reorganize and collect data from multiple workbooks

    Hello bobfor1,

    Sorry, I forgot to add the Row property at the end. The statement should be...
    Please Login or Register  to view this content.

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

    Re: Macro to reorganize and collect data from multiple workbooks

    Assuming the two options you've been given will give you what you need, be sure to select Thread Tools from the menu above and mark the thread as solved. Thanks.

+ 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