For example I have a cell containing "HC17C.pdf" I would like to find and open the file "HC17C.pdf" located in my computer under no specific folder. I know I could simply hyperlink it but it's a community file and people often reorganize and that breaks the hyperlink. I'm essentially looking for a hyperlink that won't get broken if the files path changes. Thanks for any help!
Here's the hyperlink code that I used in the past:
Sub likwrite()
'
' linkwrite Macro
' Macro written 2/19/2003 by Al Olson
'
' Keyboard Shortcut: Ctrl+r
' Worksheets(1).Activate
w = ActiveCell.Row
'Worksheets(1).Select
Range("K" & w).Select
x = ActiveCell.Offset(0, -9).Value
If Left(x, 4) = "File" Then
MsgBox (x & ". You may look up the drawing on the master sheet and then look in the vault.")
Else
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:=(x), _
TextToDisplay:="click to open"
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
'Application.WindowState = xlNormal
End If
End Sub
Sub auto_open()
Sheets("Sheet1").Select
Range("B57").End(xlDown).Offset(1, 0).Select
ActiveCell.Value = Application.UserName
ActiveCell.Offset(0, 1).Value = Now()
Range("A1").Select
Sheets("Sheet1").Select
'ActiveWorkbook.Save
End Sub
Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #2 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer
Bookmarks