Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

hyperlink and plain text in the same cell...

3 views
Skip to first unread message

Andrew

unread,
May 8, 2003, 1:06:06 PM5/8/03
to
Is there any way of combinin plain text and a hyperlink in the same
cell.

Lets say that I am in cell A1 and I have the following text:

Visit Google Group at http://groups.google.com every day


The ONLY think that I want hyperlinked is the actual URL of
http://groups.google.com and not the entire cell contents.

Any ideas?

BrianB

unread,
May 9, 2003, 8:37:01 AM5/9/03
to
Anything wrong with :-
=HYPERLINK("http://groups.google.com","Visit groups.google.com every day.")
??

Regards
BrianB
=====================================


goo...@totallynuts.org (Andrew) wrote in message news:<1e4db646.03050...@posting.google.com>...

Andrew M

unread,
May 9, 2003, 11:31:43 AM5/9/03
to

Using =HYPERLINK("http://groups.google.com","Visit groups.google.com
every day.") does work, but the entire thing would be a hyperlink.

In the cell I am looking for plain text AND a hyperlink.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Dave Peterson

unread,
May 9, 2003, 10:21:32 PM5/9/03
to
Is it important enough to simulate the effect?

This will work for text, not formulas:

I put this in a cell:


Visit Google Group at http://groups.google.com every day

I highlighted http://groups.google.com and did format|cells.
I gave it an underline and blue font color.

Then I used the Drawing toolbar and dragged a Rectangle on top of that cell. I
held the alt-key and dragged by the corners to fill the cell exactly.

I rightclicked on the rectangle and chose Format autoshape. I made the
transparency 100%. I changed the color of the line (border) to "no Line".

I inserted this code into a general module.

Option Explicit
Sub jumptoHyperlink()

Dim myCell As Range
Dim httpPos As Long
Dim spacePos As Long
Dim myLink As String

Set myCell = ActiveSheet.Rectangles(Application.Caller).TopLeftCell

With myCell
httpPos = InStr(1, .Value, "http://", vbTextCompare)
If httpPos = 0 Then
Exit Sub
Else
spacePos = InStr(httpPos, .Value, " ")
If spacePos = 0 Then
spacePos = Len(.Value)
End If
myLink = Mid(.Value, httpPos, spacePos - httpPos + 1)
End If
End With

ThisWorkbook.FollowHyperlink Address:=myLink, NewWindow:=True

End Sub

Then I went back to my rectangle and rightclicked and assigned it this macro.

It uses the .topleftcell to get the value of the cell under it. So you can
assign this macro to as many rectangles as you want.

It does have to have something to pick out the link. I used http:// and the
trailing space (or end of value) to pick this one apart.

You might want to add ftp://, mailto:// and https:// into the mix.

--

Dave Peterson
ec3...@msn.com

0 new messages