+ Reply to Thread
Results 1 to 8 of 8

Compiling Data from Multiple Stardardized Excel Files into ONE Excel Master File

  1. #1
    Registered User
    Join Date
    01-03-2013
    Location
    Saudi Arabia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Question Compiling Data from Multiple Stardardized Excel Files into ONE Excel Master File

    Hi There,

    I have a few hundreds of Excel files that contain data collected from users that I need to compile/combine in one separate excel file for analysis. Some of the data is in column format and all contained in one sheet. I use Excel 2010 and have very limited knowledge of Macros or Visual basic. Attached is a copy of the sample file containing the data that needs to be imported into the master file. The exact cells that need to be collected are as follows:

    Column C/D (merged) - Row 11 to 19
    Column E - Rows 22 to 63 (please note that the rows are merged, so each group of three consecutive rows actually contain on data item in column E)

    The cells to be collected are all colored in Yellow in the excel file attached.

    The compiled master file needs to have one row for each excel file containing the date. All Identification information for students and instructors should come first, followed by the student score. (i.e. one row per excel file collected).

    Please let me know if I need to provide anything else.

    I would greatly appreciate it if someone can guide me on how to create the desired master file.

    Regards,
    -Ammr
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    01-03-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Compiling Data from Multiple Stardardized Excel Files into ONE Excel Master File

    This workbook should do it. It will need some customization from your part.

    It will also only work with the file name you provided us with. You can improve it by having a variable bear the file name. You can google that, it should be fairly easy. You can also improve it by having it close the file after use, improve format or make it more efficient with a leaner code.

    To enter another file, press the commandbutton again, the new set of data will be added in the next row. You can also run a batch of files, but that's more complicated.

    Hope this helps.

    Winch
    Attached Files Attached Files
    Last edited by winch; 01-03-2013 at 09:21 PM.

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

    Re: Compiling Data from Multiple Stardardized Excel Files into ONE Excel Master File

    Hi Ammr,

    Where are the files to be compiled? Are they in different books, different sheets, or several per sheet in various books?????

    Here's how I would start your program: (the OCR sheet must be activated)

    Please Login or Register  to view this content.
    To get it to run I had to change the Year - I changed it to 2011!!!

    AND, I inserted a Worksheet in your book!

    Directions for running the routine(s) just supplied in a module

    Copy the code to the clipboard

    Press ALT + F11 to open the Visual Basic Editor.

    Open a macro-enabled Workbook or save your Workbook As Macro-Enabled

    Select “Module” or “Sheet” as directed above from the Insert menu

    Type "Option Explicit" then paste the code into the white space on the right

    With the cursor between Sub and End Sub press F5 (F8 to Single Step)

    OR

    Press ALT + Q to close the code window.

    Press ALT + F8 then double click on the macro name
    Last edited by xladept; 01-04-2013 at 02:40 AM.
    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

  4. #4
    Registered User
    Join Date
    01-03-2013
    Location
    Saudi Arabia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Compiling Data from Multiple Stardardized Excel Files into ONE Excel Master File

    Hi there!

    First of all, to answer your question. My data is in various (hundreds) of workbooks (and I mean by that independent excel files) stored in one directory file on my hard drive. I tried to run the script as instructed above and faced the following issues:

    1. When I click on the insert menu in the VB Editor I only see the option "Module" NOT "Sheet"

    2. When I ran the macro, the actual worksheet had formed all the headers correctly, but no names and zeros for all numeric data. (the Oral Communication Rubric excel worksheet was open or active as you say)

    I am not sure really how to proceed from here. Really appreciate some further help.

    Regards,
    -Ammr

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

    Re: Compiling Data from Multiple Stardardized Excel Files into ONE Excel Master File

    To run the routine you need the Oral Communication Rubric "up" - I guess that you inserted a Worksheet, or it wouldn't have run at all. But is it one book one rubric and are the Worksheets all named "Oral Communications Rubric"??? - I'll proceed on that assumption; with a technique known as "running the directory".

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

    Re: Compiling Data from Multiple Stardardized Excel Files into ONE Excel Master File

    To run the routine you need the Oral Communication Rubric "up" - I guess that you inserted a Worksheet, or it wouldn't have run at all. But is it one book one rubric and are the Worksheets all named "Oral Communications Rubric"??? - I'll proceed on that assumption; with a technique known as "running the directory".

    This is set up so that the book that you're collecting the data in is in the same folder as the others and has a worksheet named "Sheet1"

    Please Login or Register  to view this content.
    Last edited by xladept; 01-04-2013 at 03:58 PM.

  7. #7
    Registered User
    Join Date
    01-03-2013
    Location
    Saudi Arabia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Compiling Data from Multiple Stardardized Excel Files into ONE Excel Master File

    OK This sounds great! Yes, all rubrics files have the same name.

    Now to run this code, do I need to follow the same steps mentioned in the earlier post? Also, do I need to edit the code somewhere to specify the directory where all the workbooks are located? and If so, what is the format I need to follow to specify the directory?

    Finally, is there anything in the code I need to customize or edit before I run it again?

    Thanks a lot for your patience and tremendous support.

    Regards,
    -Ammr

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

    Re: Compiling Data from Multiple Stardardized Excel Files into ONE Excel Master File

    If you're going to run it from one of the source books then you need to get rid of that bypass line that I commented on. As long as you have the client book in the same folder then the path should take care of itself!

    Yes - put the code in a module in the client book - you can't insert a sheet from the VBE, but you can click on a sheet in the VBE - but we're not using any sheet code here.

    Alternate code for the path "P" would be something like this;

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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