rjplante
Well-known Member
- Joined
- Oct 31, 2008
- Messages
- 574
- Office Version
- 365
- Platform
- Windows
I would like to be able to open a dialog box, have the user select the file of interest, and then paste the file address into a particular cell.
I have the macro started, I just don't know the correct language to get the file address. If someone could tell me the code to get that dialogue box to appear and select the file, that would be awesome.
Thanks for the help,
Robert
Here is what I have so far.
I have the macro started, I just don't know the correct language to get the file address. If someone could tell me the code to get that dialogue box to appear and select the file, that would be awesome.
Thanks for the help,
Robert
Here is what I have so far.
Rich (BB code):
Sub PDF_SETUP()
If Range("Z40").Value = "" Then
Dim mypath As String
Dim myfile As String
mypath = ThisWorkbook.Path
'Display dialog box to get file address.
myfile = ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
Display dialogue box here _
"file name here", TextToDisplay:= "file name here.pdf"
Range("Z40").vlaue = myfile
ElseIf Range("Z40").Value <> "" Then
Worksheets("Intro Page").Range("Z40").Hyperlinks(1).Follow
End If
End Sub