+ Reply to Thread
Results 1 to 15 of 15

Copy specific data from multiple files to one file

  1. #1
    Forum Contributor
    Join Date
    08-02-2015
    Location
    Canada
    MS-Off Ver
    Office 2010
    Posts
    129

    Copy specific data from multiple files to one file

    Hi,

    I'm not sure if this is possible. What I have are daily deposits where I need to copy the highlighted information from these deposits onto a master excel file.

    On the master file called (for example) "DEPOSIT_SLIP_SEP_16" the information required from each of the the deposits are:

    column B "Batch Total" - total of the deposit (highlighted)
    column C - "Account_Number" - from column A on the deposit sheet (highlighted)
    column D - "Amount" - the amount from each line item on the deposit sheet (highlighted)
    column A - "Batch ID" - this indicates that row belongs to the same deposit sheet. Example Batch ID 1 is one deposit (with 2 entries but they both came from the same deposit so rows 2 and 3 both have the same number in column A),
    Batch ID 2 is another deposit, Batch ID 3 is another deposit, etc.....

    Basically every day when there are new deposits the highlighted information is moved onto the master sheet (the master sheet is overwritten every day). Is there a way to create a macro to have the highlighted information copied onto the master sheet automatically?

    I have attached the individual deposits and the master sheet (already filled out) to show as an example.

    Any help would be appreciated

  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 data from multiple files to one file

    Assuming all of these deposit forms are found in a specific folder on your computer
    Assuming you want all the files in the folder processed (or is it just the ones that start with 09162016, or 09172016, etc?)

    Anything else?
    _________________
    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: Copy specific data from multiple files to one file

    This little tool seems to do all the right things. Just edit the macro to point the fPATH to the folder where all your deposit files will be stored.

    The macro will create a deposit sheet for the date you name, then import all the files from the fPATH that start with that date.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    08-02-2015
    Location
    Canada
    MS-Off Ver
    Office 2010
    Posts
    129

    Re: Copy specific data from multiple files to one file

    Hello,

    The files are in separate folders and separate locations but I think we can move them to a central location if that makes it easier.
    Yes we would like all the files processed please.

    Thanks so much

  5. #5
    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 data from multiple files to one file

    Give it a try as is, let me know. Your example seemed to want the deposit slips from a specific day. Let me know how it works for you.

  6. #6
    Forum Contributor
    Join Date
    08-02-2015
    Location
    Canada
    MS-Off Ver
    Office 2010
    Posts
    129

    Re: Copy specific data from multiple files to one file

    Hi There,

    Thank you for your reply. I inserted the path name as indicated. Once I hit the macro and entered the deposit date 09162016 I see the extra sheet created but the data did not transfer over.
    Perhaps there is something I'm missing. Below is the code with my path name.
    Thanks so much


    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: Copy specific data from multiple files to one file

    This was my original line of code:
    Please Login or Register  to view this content.
    You removed the comment that was meant to keep you from making this mistake.

    Add the missing \ at the end, try again.

  8. #8
    Forum Contributor
    Join Date
    08-02-2015
    Location
    Canada
    MS-Off Ver
    Office 2010
    Posts
    129

    Re: Copy specific data from multiple files to one file

    Oh my gosh. It's absolutely perfect!!
    You're the best!

    Thank you so much.

  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: Copy specific data from multiple files to one file

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  10. #10
    Forum Contributor
    Join Date
    08-02-2015
    Location
    Canada
    MS-Off Ver
    Office 2010
    Posts
    129

    Re: Copy specific data from multiple files to one file

    Hello,

    Apologies. When I tried with a real deposit, the Account Number and Amount did not populate and the 2 line entry batch lumped both entries in the same line on the deposit slip.
    The only change I can think of is I blanked out the banking info on the deposits. The real deposits are also in protected mode and the top headers (banking info) is read only.
    The Account # and Amount on the deposits also are not highlighted on the actual deposits.

    I tested the other original ones I posted successfully even changed the dates up with success. Not sure if something I noted above affected the live testing?
    Sorry to trouble

  11. #11
    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 data from multiple files to one file

    I dropped those two deposits into my folder and ran the macro using date 9/14/2016 and got this:
    http://screencast.com/t/OzKzJgeLJR3

    It looks correct to me.

  12. #12
    Forum Contributor
    Join Date
    08-02-2015
    Location
    Canada
    MS-Off Ver
    Office 2010
    Posts
    129

    Re: Copy specific data from multiple files to one file

    Hello,

    I think I know what the problem is with my live deposits. The worksheet is protected. The testing deposits are not protected. Once I protect them the account number and amounts do not populate.

    Is there by any chance a workaround to this?
    Much appreciated

    Capture.PNG

  13. #13
    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 data from multiple files to one file

    Protected with no password, add this:
    Please Login or Register  to view this content.
    If there IS a password, then add that password to that line as the next word in quotes:
    Protected with password, add this:
    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 09-20-2016 at 08:28 PM.

  14. #14
    Forum Contributor
    Join Date
    08-02-2015
    Location
    Canada
    MS-Off Ver
    Office 2010
    Posts
    129

    Re: Copy specific data from multiple files to one file

    That's perfect. Thanks so much. It works great.
    Appreciate all the help.

  15. #15
    Forum Contributor
    Join Date
    08-02-2015
    Location
    Canada
    MS-Off Ver
    Office 2010
    Posts
    129

    Re: Copy specific data from multiple files to one file

    Hi. Sorry to poke one last time.
    Is it possible to have the date format accept both 09262016 as well as 20160926?

+ 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. copy specific cells from multiple .xlsx files into a table in destination file
    By khhleung in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-09-2014, 07:18 PM
  2. [SOLVED] HELP: Copy Data from Multiple CSV files to an output xls file
    By Anatawan in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-31-2014, 12:33 AM
  3. [SOLVED] How to Extract Data from Multiple Files in Same Folder and Copy Data to One File
    By champ052005 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-10-2013, 01:25 PM
  4. [SOLVED] Importing specific data from multiple text files in a file directory into excel
    By abat in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 07-03-2013, 05:26 PM
  5. Using a macro to pull specific data from multiple files into a master file
    By bocaj315 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-04-2013, 09:31 AM
  6. Open a file and copy data into multiple files
    By ncduke in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-12-2010, 09:39 AM
  7. [SOLVED] How do I pull data from multiple files and copy into one file
    By JT in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-03-2005, 03:06 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