+ Reply to Thread
Results 1 to 6 of 6

Copy specific cells from multiple workbooks and import them to a master workbook

  1. #1
    Registered User
    Join Date
    06-26-2012
    Location
    london, england
    MS-Off Ver
    Excel 2010
    Posts
    5

    Copy specific cells from multiple workbooks and import them to a master workbook

    I have created a simple form in excel for an employee time card and there will be a time card for each employee. At the end of the day the data needs to be input into our ERP system. I was looking to write a macro that takes the data from all the time cards and drops that data into a master file. From the master file i will then export the data to a .txt file with a fixed width. I have the export to a .txt file figured out already but I am having issues with getting the data from all the files into one. One of the issues is that the data is not lined up in straight-forward columns and rows otherwise easily import it. The macro needs to be able to select the cells with the data and import it to the master file in a simple row/column layout. I have attached a copy of the time card to get a better understanding. There should be a row for each job number. Let me know if more explaining is required because it is somewhat confusing to explain. The remarks column is not needed and I have removed the data from the lists below but that can easily be filled in with sample data and will appear in the drop down boxes.
    Attached Files Attached Files

  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: Copy specific cells from multiple workbooks and import them to a master workbook

    You should provide 2-3 sample timecards with sample data in them showing all the variations you receive.
    You should provide a sample "Results" sheet showing how the data from the timecards above would be laid out when it was imported.

    By showing us the BEFORE and AFTER, the in-between is much easier to accomplish.
    _________________
    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
    06-26-2012
    Location
    london, england
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Copy specific cells from multiple workbooks and import them to a master workbook

    Timecard.xlsMaster.xlsYou can just copy the time card three times if you want. On this attachment you can now see how that data will look. I just want to know if there is a way to grab all of data(of which you can now see) in the in the entry areas. I have tried linking the data and copying the cells with a macro but that will not work with the drop down boxes. You can look at the master file to see which data that I need. The reason I want to do this is we are looking to have the employees enter the information on a tablet so there a few compatibility issues with the tablet app. The drop down boxes are being used to reduce employee error by not having them type in the data.

  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: Copy specific cells from multiple workbooks and import them to a master workbook

    Like so... be sure to edit the fPATH to the folder where all the timecards will be saved.
    Please Login or Register  to view this content.

    This macro is installed in your sample MASTER sheet where all the formatting and titles have already been readied and columns formatted. After fixing the macro to use the correct folder, you can just press the button to run it.
    Attached Files Attached Files
    Last edited by JBeaucaire; 06-27-2012 at 09:24 PM.

  5. #5
    Registered User
    Join Date
    06-26-2012
    Location
    london, england
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Copy specific cells from multiple workbooks and import them to a master workbook

    Thanks a lot I'm slowly getting the hang of VBA so this helps me out quite a bit.

  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: Copy specific cells from multiple workbooks and import them to a master workbook

    If that takes care of your need, please select Thread Tools from menu above and set this topic 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