Is it possible to create a hyperlink within an Excel cell which only uses a section of the cell text for the clickable link? I.E. would the below table mockup represent something that can be easily built in Excel 2010?
a mock up http://dl.dropbox.com/u/14119404/misc/Microsoft%20Excel%20-%20Book1_2012-04-16_14-24-47.jpg
I know that an entire cell can be made into a hyperlink easily, but not a specific part of the cell as far as I know.
By hyperlink I also refer to either
Thanks
After creating the hyperlink you could format the text in the cell so that only the words of interest are underlined/blue. The hyperlink will still work, but obviously you can still have only one link per cell, and clicking anywhere in the text will trigger the hyperlink.
For example:
Sub Tester()
Dim rng As Range
Set rng = ActiveSheet.Range("A1")
rng.Parent.Hyperlinks.Add Anchor:=rng, Address:="", SubAddress:= _
"Sheet1!A10", TextToDisplay:="this is long text"
With rng.Font
.ColorIndex = xlAutomatic
.Underline = xlUnderlineStyleNone
End With
With rng.Characters(Start:=9, Length:=4).Font
.Underline = xlUnderlineStyleSingle
.Color = -4165632
End With
End Sub
I needed to link to a filename displayed in a cell, so here is what worked for me:
ActiveSheet.Hyperlinks.Add Anchor:=Cells(row, column), Address:=file.Path, TextToDisplay:=file.Path
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With