Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

excel macro - make cell text into hyperlinks

Status
Not open for further replies.

chomp99

IS-IT--Management
Apr 18, 2003
9
0
0
US
Hi,

I have a column of keywords in Excel that I would like to convert to hyperlinks with a macro. I would like the hyperlink url to be concatenated with a variable equal to the keyword in the cell. I would also like any spaces in the words of the cell to be translated to "+" sings in the url. Can anyone help? This seems like an easy macro but I don't know VBA programming to do this yet:

Example:
eye candy
candy

Turns to hyperlinked words
eye candy (candy (
THANKS!!
chomp99
 
Hi,

Start by turning on your macro recorder and manually inserting a hyperlink.

The look at your reccorded code and post back if you need help.

Skip,
[sub]
[glasses] [red]Be advised:[/red] The dyslexic, agnostic, insomniac, lays awake all night wondering...
"Is there really a DOG?" [tongue][/sub]
 
I used the macro recorder. I would have to find a way to alter the code to add the cell word into the url:

Sub Macro1()

Range("B87").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
" TextToDisplay:="candy"

End Sub
 
Code:
Sub Macro1()

    with ActiveCell
       ActiveSheet.Hyperlinks.Add _
         Anchor:=ActiveCell, _
         Address:= "[URL unfurl="true"]http://www.example.com?var="[/URL] & .Value, _
         TextToDisplay:=.Value
    end with
End Sub


Skip,
[sub]
[glasses] [red]Be advised:[/red] The dyslexic, agnostic, insomniac, lays awake all night wondering...
"Is there really a DOG?" [tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top