Dr. Demento
Well-known Member
- Joined
- Nov 2, 2010
- Messages
- 608
- Office Version
-
- 2019
- 2016
- Platform
-
- Windows
I'm trying to create a hyperlink based on a passed range. The link location I can manage, but the destination sheet/range is giving me fits. 
I can assign the destination sheet using the .Parent function, but I can't pair the sheet and range for anything! The function quits at setting the Range. I assume the final range needs to be Sheets(gnr.parent).Range(gnr) but that doesn't work.
What am I doing wrong??
I'm using Tim William's code below to create the hyperlink (excel - Create Hyperlink to sheet in cell VBA - Stack Overflow) but it never progresses that far.
Thanks y'all!
I can assign the destination sheet using the .Parent function, but I can't pair the sheet and range for anything! The function quits at setting the Range. I assume the final range needs to be Sheets(gnr.parent).Range(gnr) but that doesn't work.
What am I doing wrong??
Code:
Set shtLinkDest = gnr.Parent
With shtLinkDest
Set rngLinkDest = .Range(gnr)
End With
I'm using Tim William's code below to create the hyperlink (excel - Create Hyperlink to sheet in cell VBA - Stack Overflow) but it never progresses that far.
Code:
cellHyperlink rngLinkLoc, _
rngLinkDest, _
CStr(rtsdata)
Thanks y'all!