Hi,
So I have a list of IDs in Sheet1. I am trying to replace them with hyperlinks using the below but I cannot seem to get VLOOKUP to work properly in VBA. I've tried to replace the "URL" string with a VLOOKUP to get the URLs that are on Sheet2, but everything I've tried has resulted in errors. Is there a way to get the Address with a simple VLOOKUP in the loop belew? Any help appreciated!
So I have a list of IDs in Sheet1. I am trying to replace them with hyperlinks using the below but I cannot seem to get VLOOKUP to work properly in VBA. I've tried to replace the "URL" string with a VLOOKUP to get the URLs that are on Sheet2, but everything I've tried has resulted in errors. Is there a way to get the Address with a simple VLOOKUP in the loop belew? Any help appreciated!
VBA Code:
Sub GetHyperlink()
For Each xCell In Range("A:A")
If xCell.Value <> "" Then
ActiveSheet.Hyperlinks.Add Anchor:=xCell, Address:="URL", TextToDisplay:=xCell.Value
End If
Next xCell
End Sub