+ Reply to Thread
Results 1 to 6 of 6

Macro: Search for a file name in a specified folder and link to excel cell

  1. #1
    Registered User
    Join Date
    05-31-2012
    Location
    Portland
    MS-Off Ver
    Excel 2010
    Posts
    6

    Macro: Search for a file name in a specified folder and link to excel cell

    Hi!

    I need a macro to read the contents (policy number) in a cell (A2), then search for a file name in a certain folder that starts with the contents of that cell then link that file to other cells (B2,C2,D2) and repeat the process down the column.

    I have no idea how to search for a file name using excel, so any help would be amazing. Thanks!


    Ex. Book1.xlsx

  2. #2
    Registered User
    Join Date
    05-31-2012
    Location
    Portland
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Macro: Search for a file name in a specified folder and link to excel cell

    So I started writing something...
    Please Login or Register  to view this content.
    I'm using windows 7, and I *THINK* I just need something to actually search a specified PDF folder... I just have no idea how to do that. Seriously, any help would be AMAZING. Even if it was just a hint at a place to look for ideas. I'm so lost/stuck/frustrated. I really don't care about linking anything. Just finding the darn files.

    I really don't get how vba works (kinda just learned as i went along for the past two weeks or so), and I kinda just made up that code with NO IDEA what it means

  3. #3
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Macro: Search for a file name in a specified folder and link to excel cell

    jr13,

    Are the Claim Form, Death Certificate, and Payment Proof files in different folders, or all in the same folder? As for how to search through the files in a folder, this should get you started:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    05-31-2012
    Location
    Portland
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Macro: Search for a file name in a specified folder and link to excel cell

    They are all in the same folder.. the path name is basically J:\COMPANYBLAH\Reinsurance\Claims\YEAR\CLIENT\Proofs\

    Do you know how to edit that so it would look for a file name that started with a certain number and was in pdf format? and is it possible when entering the folder location to stop after the folder "Claims", so the search looks in all years and all client folders?

  5. #5
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Macro: Search for a file name in a specified folder and link to excel cell

    jr13,

    Give this a try. Run tgr, not GetFiles. GetFiles is called by tgr.
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-08-2013
    Location
    regina, canada
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Macro: Search for a file name in a specified folder and link to excel cell

    Thanks very much

+ 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