+ Reply to Thread
Results 1 to 6 of 6

Look for 'text' in column, check if image exists and create hyperlink?

  1. #1
    Registered User
    Join Date
    06-18-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    4

    Question Look for 'text' in column, check if image exists and create hyperlink?

    This may be a macro question but I've been driving myself nuts trying to figure it out so I find myself on this forum. What I'm trying to do is this;

    Look for 'text' in a column, check a specific folder to see if an image exists with that same 'text' in the column, and if so, create a hyperlink to that image.

    Example:

    Column #1
    001
    002
    003

    Check field '001' to see if a file called '001' exists in "C:\images\". If it does, create a hyperlink in that field to point to "C:\images\001.jpg".

    Is this possible? I'd appreciate any and all help!
    Last edited by altiman; 06-19-2013 at 09:52 AM.

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Look for 'text' in column, check if image exists and create hyperlink?

    definitely need some VBA for the file exist checking

    check this link for the file checking
    http://vbadud.blogspot.com.au/2007/0...existence.html
    **i have tested this and it works

    hyperlink() function for the rest
    Last edited by humdingaling; 06-18-2013 at 11:17 PM.
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Look for 'text' in column, check if image exists and create hyperlink?

    the way i set it up
    column A is your data
    column B is combination of directory and adding .jpg
    Please Login or Register  to view this content.
    column C is combination of the above function and if statement
    Please Login or Register  to view this content.
    Column D is
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-18-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Look for 'text' in column, check if image exists and create hyperlink?

    I managed to get it to work with a bit different vba code. But now I'd like to have the hyperlink ("Click") show up in the next column over instead of overwriting the text in the initial field it is checking and matching an image up to. Any ideas?

    Please Login or Register  to view this content.
    Moderators note: code tags added for you - this time
    Last edited by FDibbins; 06-18-2013 at 11:26 PM.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Look for 'text' in column, check if image exists and create hyperlink?

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code in [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  6. #6
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Look for 'text' in column, check if image exists and create hyperlink?

    Please Login or Register  to view this content.
    change your anchor

+ 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