VBA to Hyperlink to file based on cell text

needVBAH3lpplease

New Member
Joined
Dec 11, 2014
Messages
2
I have a interesting one i hope you can help me with.

I have audit documents that contain a column with a photos filename
ie.
WIN_20141125_10.JPG
WIN_20141125_15.JPG
WIN_20141125_155.JPG
WIN_20141125_44.JPG
WIN_20141125_12.JPG

<tbody>
</tbody>

The file name relates to a file one subfolder belong the current workbooks path

I need a VB script that will look one subfolder below the folder the current workbook resides, and hyperlink to the file with the same filename as the selected cell /cells.

For instance.

I select cells A1 and A2 (WIN_20141125_10.jpg and WIN_20141125_15.jpg), and want the macro to search in "currentworkbook.path\photos" for the corresponding filenames, and change the text in cells A1 and A2 into hyperlinks to the files, keeping the same text.


The reason this is required, is because multiple of the same excel documents are recieved each month, and all need to have hundreds of hyperlinks setup in the document. The workbook location isn't always going to be the same, but the photos are always going to be in a subfolder called "photos" in the workbooks location.

I know very little about VB scripting, but im sure this must be possible- Please help!!
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

Forum statistics

Threads
1,213,513
Messages
6,114,072
Members
448,546
Latest member
KH Consulting

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top