+ Reply to Thread
Results 1 to 3 of 3

Assign Hyperlink to cell if data matches files from a folder/sub folder

  1. #1
    Registered User
    Join Date
    09-10-2012
    Location
    Bangkok, Thailand
    MS-Off Ver
    Excel 2003
    Posts
    11

    Assign Hyperlink to cell if data matches files from a folder/sub folder

    Hi I am having a problem in assigning a hyperlink to a cell if the cell data matches files from folders and sub folders
    This is the particular line that I am having trouble with:

    If ActiveCell = File_Name Then ActiveCell.Hyperlinks.Add ActiveCell, Address:=File_Path

    Although the File_Name and the activeCell value appear the same the line does not recognize that


    Please Login or Register  to view this content.
    Any help that you can give would be appreciated
    Thanks in advance

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Assign Hyperlink to cell if data matches files from a folder/sub folder

    This comparison is case sensitive. Try this to make it case insensitive.

    Please Login or Register  to view this content.
    This is not looping through the cells. The Active cell never changes.
    Please Login or Register  to view this content.
    Instead of using a nested loop (loop through file names and then loop through cells), you could loop through file names and use the .Find method to look for a match. Try this (not tested)
    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    09-10-2012
    Location
    Bangkok, Thailand
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Assign Hyperlink to cell if data matches files from a folder/sub folder

    Thank you, I used your last suggestion and it worked fine

+ 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. Replies: 1
    Last Post: 01-28-2019, 06:55 PM
  2. [SOLVED] VBA Code to save to a folder within a folder within a folder all based on cell values.
    By sintek in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-24-2016, 04:24 PM
  3. [SOLVED] Transfer data from all the files in a folder to all the files in another folder
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-17-2015, 02:06 PM
  4. [SOLVED] Creating multiple hyperlinks to files in a folder - one file per hyperlink per cell
    By fsusd in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-06-2014, 12:17 PM
  5. Copy Folder Name to Cell with hyperlink to the folder
    By roy__lam in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-13-2013, 11:29 AM
  6. copying data from excel files in a source folder to target folder
    By Javed07 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-22-2013, 04:27 PM
  7. Hyperlink files from folder or sub-folder for the whole workbook
    By Yani.Mio in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-16-2012, 05:38 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