J
Jay
Hi all -
I'm trying to place a hyperlink in the ActiveCell with the hyperlink
pointing to a cell on a sheet in a closed workbook. I'm committed to using
the hyperlink object and not the function =Hyperlink(etc...).
The following code fails on the line before End Sub, presumably because the
variable hypAddress violates syntax rules for the "Address:=" argument of the
Hyperlinks.Add method. Any advice about constructing a valid string for the
hypAddress string variable would be appreciated.
Sub hLink()
iw = 7
folderPath = "G:\My Documents\"
fName = "Test.xls"
hypAddress= folderPath & fName & Sheets(iw).Name & "!A1")
ActiveSheet.Hyperlinks.Add Anchor:=ActiveCell, Address:=hypAddress,
TextToDisplay:=iw
End Sub
I'm trying to place a hyperlink in the ActiveCell with the hyperlink
pointing to a cell on a sheet in a closed workbook. I'm committed to using
the hyperlink object and not the function =Hyperlink(etc...).
The following code fails on the line before End Sub, presumably because the
variable hypAddress violates syntax rules for the "Address:=" argument of the
Hyperlinks.Add method. Any advice about constructing a valid string for the
hypAddress string variable would be appreciated.
Sub hLink()
iw = 7
folderPath = "G:\My Documents\"
fName = "Test.xls"
hypAddress= folderPath & fName & Sheets(iw).Name & "!A1")
ActiveSheet.Hyperlinks.Add Anchor:=ActiveCell, Address:=hypAddress,
TextToDisplay:=iw
End Sub