I have written a macro that performs a VLookup
but I need it to return a hyperlink and not just a text string. There is a hyperlink in the range so all I need it to do is copy it into my result.
How can I change this VBA?
Sub check()
On Error GoTo MyerrorHandler:
Dim claim_number As String
Dim here As String
claim_number = InputBox("please enter claim number")
If Len(claim_number) > 0 Then
Set myrange = Range("claims")
here = Application.WorksheetFunction.VLookup(claim_number, myrange, 3, False)
MsgBox "Claim has been investigted, info is here " & here
Else
MsgBox "You didn't enter a claim number"
End If
Exit Sub
MyerrorHandler:
If Err.Number = 1004 Then
MsgBox "Claim has not been invsetigated"
End If
End Sub
The VLookup
works fine but instead of copying the hyperlink from my range it just returns the text. I have tried everything but cannot get it to work.