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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add URL to value in excel

Status
Not open for further replies.

doorbreaker

Programmer
Nov 19, 2002
91
GB
Hi,

Bit of an excel/VBA dunce so I'm hoping to enlist someone's help.

I have a column of values, all numeric. I need to add a URL to the start of each value e.g:

in cell in excel#

Any ideas of how to do this?

Thanks

Chris
 
Hi Chris,

Assuming you want them to be hyperlinks (and assuming they're in column A) then ...
Code:
[blue]For Each Cel In ActiveSheet.Range(ActiveSheet.Range("A1"), ActiveSheet.Range("A65536").End(xlUp))
    Cel.Hyperlinks.Add Anchor:=Cel, Address:="[URL unfurl="true"]http://www.test.com/testproduct?testid="[/URL] & Cel.Text
    Cel = "[URL unfurl="true"]http://www.test.com/testproduct?testid="[/URL] & Cel.Text
Next
ActiveSheet.Columns("A").AutoFit[/blue]

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top