+ Reply to Thread
Results 1 to 10 of 10

search for file, if exist, mark cell and create link

  1. #1
    Registered User
    Join Date
    01-15-2014
    Location
    Riga
    MS-Off Ver
    Excel 2013
    Posts
    5

    search for file, if exist, mark cell and create link

    hi!

    i would like to ask someone to help me program macro. i have only beginner knowledge about programming in excel.

    i have excel file, i attached it.

    this is how looks my directory:

    screen.png

    in excel is column D, which contains details name, in folder DETAILS is *.pdf file with same name, for example DSB-100.pdf.

    i would like to check is file exist, then mark cell N in green and create link to this file if not, then mark cell red.

    of course it should work like, if checking data in D3 then mark N3, if checking data in D4 then mark N4 and so on.

    i hope that commented clear enough.

    thanks in advance.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: search for file, if exist, mark cell and create link

    Hi

    i will get back to you soon
    Thanks - Naveed
    -----------------------------
    If the suggestion helps you, then Click * to Add Reputation
    To Attach File: Go Advanced>>Manage Attachments>>Add Files (In Top Right Corner)>>SelectFiles>>.........Locate Your File(s)>>Upload Files>>Done (In Bottom Right)
    1. Use [code] code tags [\code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    2. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

  3. #3
    Registered User
    Join Date
    01-15-2014
    Location
    Riga
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: search for file, if exist, mark cell and create link

    will someone help?!

  4. #4
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: search for file, if exist, mark cell and create link

    try this code :


    Please Login or Register  to view this content.
    Happy Computing ,

    Xlbiznes.

    To show your appreciation please click *

  5. #5
    Registered User
    Join Date
    01-15-2014
    Location
    Riga
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: search for file, if exist, mark cell and create link

    Quote Originally Posted by xlbiznes View Post
    try this code :


    Please Login or Register  to view this content.
    thanks! it works, but i modify little bit!

    can you help little more - how to set search in subfolders to?!

    i have folder DETAILS, and in this folder is two more folders, PLATE and PROFILES.

    so DETAILS folder is main, but there is two subfolders.

    can you please help twitch your code modified by me!?

    Please Login or Register  to view this content.
    Last edited by elmoinstyle; 01-20-2014 at 08:12 AM.

  6. #6
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: search for file, if exist, mark cell and create link

    firstly , Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing.
    Highlight your code and click the [#] button at the top of the post window (if you are editing an existing post, press Go Advanced to see the [#] button).
    The result will appear like this in the post window:

    Please Login or Register  to view this content.
    ... and appear like this when posted:

    Select Code copy to clipboard
    your code here ...
    and here ...
    and here
    You can also type the code tags in manually if you prefer.

  7. #7
    Registered User
    Join Date
    01-15-2014
    Location
    Riga
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: search for file, if exist, mark cell and create link

    Quote Originally Posted by xlbiznes View Post
    firstly , Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing.
    Highlight your code and click the [#] button at the top of the post window (if you are editing an existing post, press Go Advanced to see the [#] button).
    The result will appear like this in the post window:

    Please Login or Register  to view this content.
    ... and appear like this when posted:

    Select Code copy to clipboard
    your code here ...
    and here ...
    and here
    You can also type the code tags in manually if you prefer.
    sorry! correct my mistake.

    what about search in sub-folders?!

  8. #8
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: search for file, if exist, mark cell and create link

    here you go,


    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    01-15-2014
    Location
    Riga
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: search for file, if exist, mark cell and create link

    Quote Originally Posted by xlbiznes View Post
    here you go,


    Please Login or Register  to view this content.
    thanks!!!!

  10. #10
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: search for file, if exist, mark cell and create link

    If your problem is solved, please say so clearly, and mark your thread as Solved: Click Thread Tools above your first post, select "Mark your thread as Solved". Or click the Edit button on your first post in the thread, Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Dropdown option or Edit button will not appear -- ask a moderator to mark it.

+ 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. [SOLVED] Link to file if exist
    By bongobuda in forum Excel General
    Replies: 9
    Last Post: 12-06-2010, 12:40 PM
  2. Replies: 1
    Last Post: 07-14-2007, 07:25 AM
  3. Replies: 3
    Last Post: 03-11-2006, 02:50 PM
  4. Replies: 0
    Last Post: 03-10-2006, 05:55 AM
  5. error msg of link to a file that doesn't exist
    By ayl322 in forum Excel General
    Replies: 0
    Last Post: 03-03-2005, 04:32 PM

Tags for this Thread

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