Hello all,
I am trying to build code using VBA (MS Excel 2003) that will create a hyperlink in a source workbook to a target workbook with a different fully qualified path.
Here is the code segment in question:
Just so you know, varData is a variant that use to search column labels in a range. And the variables I am using have all been declared -- the code compiles.
So my question is: is this the correct syntax to use in order to build the hyperlinks?
Thank in advance of your help,
Ben
I am trying to build code using VBA (MS Excel 2003) that will create a hyperlink in a source workbook to a target workbook with a different fully qualified path.
Here is the code segment in question:
Code:
'Create a hyperlink for the ADDRESS field to the original file.
ActiveCell.Offset(0,3).Activate
strHypAddr = ActiveCell.Address
strHypText = varData(0,2)
strHypSubAdd = "='" & funPathName(strFileToOpen & "") & _
& "\[" & funFileNam(strFileToOpen & "") & "]" & _
& varData(0,1) & "'!" & strHypAddr
Wth Worksheets (strResultsWS)
.Hyperlinks.Add .Range(strHypAddr), strHypText, strHypSubAdd
End With
Just so you know, varData is a variant that use to search column labels in a range. And the variables I am using have all been declared -- the code compiles.
So my question is: is this the correct syntax to use in order to build the hyperlinks?
Thank in advance of your help,
Ben