Tex & Hyperlinks Sharing Single Cell?

Disarmonious

Board Regular
Joined
Oct 31, 2016
Messages
129
Hello,

Is there a way for one single cell to share both text and a hyperlink? For example, I want a cell that describes something, and then after the description, I'd like there to be a hyperlink that would access a webpage extending the topic? So the text body is separate from the hyperlink, but share the same cell...
 
Last edited:

Some videos you may like

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Sam_D_Ben

Active Member
Joined
Oct 17, 2012
Messages
381
I guess something like this using VBA.



Code:
Sub Hyperlinks()

    Dim rng As Range


    Set rng = ActiveSheet.Range("A1")


    rng.Parent.Hyperlinks.Add Anchor:=rng, Address:="", SubAddress:= _
        "Sheet1!B1", TextToDisplay:="This is just a test to Links. So please check"


    With rng.Font
        .ColorIndex = xlAutomatic
        .Underline = xlUnderlineStyleNone
    End With


    With rng.Characters(Start:=24, Length:=6).Font
        .Underline = xlUnderlineStyleSingle
        .Color = -4165632
    End With


End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,096,035
Messages
5,448,022
Members
405,478
Latest member
ce1990

This Week's Hot Topics

Top