Create hyperlinks to files in folders from matching contents of cells with same folders name

New Contributor

Hi MS community, this is my first time for posting a learning discussion with Excel experience. Though I know the topic about matching(look up) and hyperlinks in VBA Excel has been repeated a lot. I have a macros that I would love to ask on how to code which I will explain the criteria of it down below with a picture for better visual explanation. 

  • The main job of the macro is to create a hyperlink for the file (e.g *.pdf, *.*) inside the folder, which folder's name matches with the content of the target cell in the the worksheet.
  • This macro will be assign to a shape in the worksheet for executing the macro.
  • When the macro run, first thing the macro should ask is the directory of the root folder which contain the sub folders, the sub folders' names are values that if match the the content of the target cell, create a hyperlink and open the file inside that matched sub folder.
  • When click on the hyperlink should open the file instead of open the folder directory.

I have done a bit of research regards to my learning for this macro. So far I have been able to create the windows popup for root folder directory. However, have not made any progress in how to create the logic for macro to match between folder name and cell content. 

 

Thank you in advance for your help on my post.

 

Here is the brief picture to explain the situation.Here is the brief picture to explain the situation.

0 Replies