0

My worksheet "input" range "B11" has generated the destination URL:

file:///C:/Results/H1230-01%20VEF%201288.doc

My worksheet "input" range "B10" has generated the text:

H1230-01 VEF 1288

How can I automatically insert the hyperlink of the destination URL with the displayed text in a cell?:

Worksheets("VEF").Range("m65536").End(xlUp).Offset(1, 0).Select

2 Answers 2

2

Use the HyperLink formula example:

=HYPERLINK("path","Text To Display")

Or with code:

Range.Formula = "=HYPERLINK(""path"",""Text To Display"")

or Using your actual references use this formula:

=HYPERLINK(B11,B10)
Sign up to request clarification or add additional context in comments.

1 Comment

thank you - i wasnt aware of this function. i have no need to do this through VBA now. cheers!
1

Also you could use the Hyperlink.Add method, like in this example from Excel-Help

With Worksheets("VEF")
    .Hyperlinks.Add Anchor:=.Range("m65536").End(xlUp).Offset(1, 0), _
        Address:=.Range("B11"), _
        ScreenTip:="Microsoft Web Site", _
        TextToDisplay:=.Range("B10")
End With

With Worksheets(1)
    .Hyperlinks.Add Anchor:=.Range("a5"), _
        Address:="http://example.microsoft.com", _
        ScreenTip:="Microsoft Web Site", _
        TextToDisplay:="Microsoft"
End With

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.