Creating a hyperlink to a file in the same directory as the workbook

MrSKR

New Member
Joined
Nov 20, 2008
Messages
27
Hi guys

I was just wondering if it was possible for a hyperlink to be created that works regardless of where the folder containing the files is stored.

I have a range of data each with its own unique ID. This ID refers to a pdf within the same folder as the workbook is stored so I have created the following formula to quickly make a link that I can fill down.

=HYPERLINK(CONCATENATE($H$2,$A2,$I$2,$J$2),$A2)
C:\Files\ 28 .pdf

The file names will always be the same and so will the folder name, however the folder may not always be stored at the top level of the C drive.

Is there a way to make this more dynamic and quickly?
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Code:
=SUBSTITUTE(CELL("filename"),TRIM(RIGHT(SUBSTITUTE(CELL("filename"),"\",REPT(" ",255)),255)),"")
This will give u the path of the open workbook. You can append the filename to that and create the hyperlink.
 
Upvote 0
=HYPERLINK(LEFT(CELL("filename"),SEARCH("[",CELL("filename"))-1)& "28.pdf")
 
Upvote 0

Forum statistics

Threads
1,215,039
Messages
6,122,802
Members
449,095
Latest member
m_smith_solihull

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