-1

All of the UDFs to display hyperlinks (that I have seen) only work where the hyperlink is a URL but they do not work where the hyperlink is another cell in the same workbook. Can anyone help me find a UDF that results in the hyperlink as text where the hyperlink is another cell in the same workbook? Thanks.

Here is a screenshot of the hyperlink, which was created using >Insert > Hyperlink..., and the cell reference that is displayed in the bubble when I hover over the hyperlink cell...

This is the cell reference that I want the UDF to return as text in any other cell.

Screenshot

  • Could you show an example of a UDF that doesn't work? – Mark Fitzgerald Aug 23 '18 at 6:41
  • UDFs can't usually be used to change a workbook or worksheet. They usually take some parameter(s) and process it to return a result, just like the built in functions like =SUM(range1, range2....). A Procedure (Sub) is built to change things on sheets or in workbooks. So when you ask about UDF do you mean a Function or Sub? – Mark Fitzgerald Aug 23 '18 at 12:43
0

Use the below code:

' Add hyperlink to a cess on Sheet2
Sheets("Sheet2").Hyperlinks.Add _
' Hyperlink must follow to a single cell A1 on Sheet1
' To follow another object (multicell range, chart, etc.) specify it
    Anchor:=Sheets("Sheet1").Range("A1"), _
' Address must be empty - it is local hyperlink
    Address:="", _
' Specify destination address where hyperlink will be placed
    SubAddress:= "Sheet2!A1", _
' Specify the text of a hyperlink
    TextToDisplay:="HyperLink to A1 on Sheet2"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.