Good afternoon. My user has asked me to amend a workbook and include the selection of a hyperlink to an 'evidence' (not police related!!) file. I think I've got as far as being able to populate the relevant cell from this input code but (ignoring any issue surrounding drive letter mapping) I'm unsure as how to make sure the cell turns into a hyperlink.
I've tried:
But it's treating "Hyperlinks" as an undeclared variable. Am I close?
Many thanks,
D€$
Code:
Private Sub EvidenceLinkButton_Click()
Dim strFileToLink As String
strFileToLink = Application.GetOpenFilename _
(Title:="Please select an Evidence file to link to")
'Checking if file is selected
If strFileToLink = "" Then
'Displaying a message if file not choosedn in the above step
MsgBox "No file selected.", vbExclamation, "Sorry!"
'And exiting from the procedure
Exit Sub
Else
UserFormAddNewEvidenceB.EvidenceLinkTextBox.Value = strFileToLink
'' Workbooks.Open Filename:=strFileToLink
End If
End Sub
................
iRow.Range.Cells(1, 2).Value = EvidenceLinkTextBox.Value ''Evidence Link
...............
I've tried:
Code:
Hyperlinks.Add Anchor:=iRow.Range.Cells(1, 2) = EvidenceLinkTextBox.Value ''Evidence Link
But it's treating "Hyperlinks" as an undeclared variable. Am I close?
Many thanks,
D€$