I want to have a hyperlink created in VBA which will jump to a specific cell when clicked, similar to an HTML anchor link.
For instance:
ActiveSheet.Hype
Try that way:
ActiveSheet.Hyperlinks.Add Anchor:=ActiveSheet.Range("E5"), Address:="", SubAddress:="Sheet1!A1", TextToDisplay:="Sheet1!A1"
You need the SubAddress
parameter of the Hyperlinks.Add method, not the Address
.
with ActiveSheet
.Hyperlinks.Add Anchor:=.Cells(1, 2), _
Address:="", _
SubAddress:= .Name & "!$B$23", _
TextToDisplay:="Test Link"
end with