+ Reply to Thread
Results 1 to 3 of 3

Macro to open files in a folder, copy data if there is a match, close them

  1. #1
    Registered User
    Join Date
    12-09-2017
    Location
    canada
    MS-Off Ver
    Office 365
    Posts
    2

    Macro to open files in a folder, copy data if there is a match, close them

    Hi all,

    I'm looking for some help making a macro.

    I have a bunch of files in a folder. I want a macro that opens up each file one by one, and if the names match, then copy the value, date and certificate associated with that name onto the master spreadsheet.


    So in the folder, I have excel files that have the following information in each sheet in the second tab:


    Certificate A8
    date Dec 9
    name2 1.3
    name3 1.5
    name6 3.0

    In the master sheet, I have the following columns:
    UNIQUENAME VALUE DATE CERTIFICATE
    name1
    name2
    name3

    I am looking for a way for excel to automatically fill in the value, date, and certificate numbers by looking them up in the sheets and pasting them into the correct row. For example, like so:




    UNIQUENAME VALUE DATE CERTIFICATE
    name1
    name2 1.3 Dec 9 A8
    name3 1.5 Dec 9 A8



    So far, I got the macro to open the file folder, and open the files one by one, but I don't know how to code it so it searches for matches, and copies the correct cells over.

    Please Login or Register  to view this content.
    Help is really appreciated!

    Thank you. =)

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486

    Re: Macro to open files in a folder, copy data if there is a match, close them

    Attaching a sample workbook enables others to work on your problem:

    To attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and click "manage attachments" to open the upload window.


    To add a file to a post

  3. #3
    Registered User
    Join Date
    12-09-2017
    Location
    canada
    MS-Off Ver
    Office 365
    Posts
    2

    Re: Macro to open files in a folder, copy data if there is a match, close them

    Solved it!
    Last edited by Sgeng4; 12-10-2017 at 09:51 AM.

+ 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. Open All Excel Files in Folder and Copy and Paste Data in Macro-Running Workbook
    By dhfinancex in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-24-2017, 01:48 PM
  2. [SOLVED] macro to open all files in a folder, save them, then close them
    By hopefulhart in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-27-2013, 06:40 PM
  3. Macros Open folder, copy, paste and close the folder
    By hahahahahahaha in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-10-2013, 05:03 PM
  4. [SOLVED] VBA Code open files in folder, copy text to workbook-Next time folder opened copy only new
    By Bikeman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-02-2013, 07:59 PM
  5. [SOLVED] Macro to open and close all files in a folder and sub folders
    By BillDoor in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-31-2012, 06:51 AM
  6. Macro to open & close mutiple xlsx files in folder
    By bernard.x in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-20-2012, 06:18 AM
  7. Macro to open, copy/paste, and close files with variable name
    By mjr33 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-15-2011, 10:20 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