+ Reply to Thread
Results 1 to 8 of 8

VBA Code to read Files

  1. #1
    Registered User
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    4

    Unhappy VBA Code to read Files

    Hi,

    I have a pretty time consuming project due tomorrow and I'm looking for some guidance on the fastest way to pull this off. I am sending an excel file containing four tabs (Block 1, Block 2, Block 3, Block 4) to 20 folks. Once they fill in scores, each of them will email me their files back. I have created a "Master" file for myself and the plan is to copy/paste the data 80 times (4 tabs X 20 attendees). I know there is an easier way to do this, but I don't know much VBA code. Is there a way I can dump all the files in a folder and have excel read and populate the data on my "Master File"? All the data is the exact same on all 20 spreadsheets with the exception of the scores and names of course. I have attached the template going to the attendees and what my "Master" file should look like. Any help is greatly appreciated.

    Niki
    Attached Files Attached Files

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: VBA Code to read Files

    Hi Niki, it's may be too late but just in case you are still in need of a solution I could do something for you.
    The "GPC Template.xlsx" workbooks would need to be renamed by the names of your attendees and placed in one folder along with your master workbook.
    Let me know if you are still looking into this.
    Regards
    Last edited by p24leclerc; 04-26-2014 at 11:29 AM.
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  3. #3
    Registered User
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: VBA Code to read Files

    Hi,

    Yes, please I am still in need of a solution. I was able to buy myself an additional day.

  4. #4
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: VBA Code to read Files

    Try this macro:
    Please Login or Register  to view this content.
    This macro will disregard any file with the following word in its name: "Template" or "Master"
    Put all the files in the same folder as your MASTER workbook. Your Master workbook will contain this macro.
    Hope it works well for you.
    Regards

  5. #5
    Registered User
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: VBA Code to read Files

    I can't thank you enough for all your help!!!

    I copy/pasted the VBA code into the Master Data File, but when I try testing nothing actually happens. Can you please let me know what I'm doing wrong.

    Thanks
    Niki

  6. #6
    Registered User
    Join Date
    02-01-2011
    Location
    California, Sacramento
    MS-Off Ver
    Excel 2010
    Posts
    92

    Re: VBA Code to read Files

    Try renaming the files as Such:

    Javed A.xlsx‎
    Mel T.xlsx‎
    etc....

    The macro provided by p24leclerc worked for me.

    Hope that helps,

    BigDawg15

  7. #7
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: VBA Code to read Files

    Simple enough, remove the word "Template" from your files' name. The macro DO NOT PROCESS files with the words "Template" and "Master" in their name. This is so you can keep you real Template within the same folder.
    Regards

  8. #8
    Registered User
    Join Date
    04-24-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: VBA Code to read Files

    Thank you!!!!

+ 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. Read Only Files
    By Mel B in forum Excel General
    Replies: 1
    Last Post: 06-25-2013, 09:48 AM
  2. VB Code to dynamically read csv files and create charts within Excel.
    By rbahadur in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 09-27-2012, 12:55 AM
  3. Macro code to read multiple text files
    By sathik in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-09-2012, 03:42 AM
  4. Replies: 6
    Last Post: 04-02-2009, 02:34 PM
  5. VB Code to 'read' .txt files and display info in Excel
    By Petitboeuf in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-19-2005, 12:00 PM

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