ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Hyperlink to document (https://www.excelbanter.com/excel-discussion-misc-queries/216737-hyperlink-document.html)

Ben Davis

Hyperlink to document
 
I want to create a hyperlink in my excel file that points to a specific
document. I same the master excel file to a new folder for every project I
do. The document I hyperlink to also is new for every project. How do I
automaticaly change the hyperlink to reflect the new folder / file location?
I wanted to set it up so that when I performed a "save as" on the master
document it would automatically change the hyperlink path to the new folder
location.

Simon Lloyd[_71_]

Hyperlink to document
 

You coild work with Excels built in dialogue box to get the filename:

Code:
--------------------
Sub GetFileName()
Dim FileName As String
FileName = Application.GetOpenFilename
ActiveSheet.Hyperlinks.Add Anchor:=Range("a1"), Address:= _
FileName, _
TextToDisplay:="What will display in Excel Goes here"
End Sub
--------------------


Ben Davis;185144 Wrote:
I want to create a hyperlink in my excel file that points to a specific
document. I same the master excel file to a new folder for every
project I
do. The document I hyperlink to also is new for every project. How do I
automaticaly change the hyperlink to reflect the new folder / file
location?
I wanted to set it up so that when I performed a "save as" on the
master
document it would automatically change the hyperlink path to the new
folder
location.



--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=51144



All times are GMT +1. The time now is 07:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com