Hi,
I'd like to use excel vba to loop through values in a column and get hyperlinks that are associated with each of those values from another sheet using Vlookup and use the original values in the column as the friendly name. Is this possible? I've tried the below code but only get Run-time error '1004': Unable to get the Vlookup property of the WorksheetFunction class. Is there anyway to get this to work?
I'd like to use excel vba to loop through values in a column and get hyperlinks that are associated with each of those values from another sheet using Vlookup and use the original values in the column as the friendly name. Is this possible? I've tried the below code but only get Run-time error '1004': Unable to get the Vlookup property of the WorksheetFunction class. Is there anyway to get this to work?
VBA Code:
Sub Get_Links_From_Hidden_Tab_Using_VLOOKUP_and_Give_It_The_Original_ID_As_Friendly_Name()
For Each xCell In Range("A:A")
Dim x As Variant
x = xCell.Value
If xCell.Value <> "" Then
ActiveSheet.Hyperlinks.Add Anchor:=xCell, Address:=Application.WorksheetFunction.VLookup(x, Worksheets("Hidden").Range("A:O"), 15, 0), TextToDisplay:=xCell.Value
End If
Next xCell
End Sub