Hyperlink to website containing wording from a cell

garbology

New Member
Joined
Mar 26, 2015
Messages
18
In column D I have a list of numbers "111112"
I would like to turn those numbers into hyperlinks I want to show the original number but the hyperlink website would be http://ph/l.aspx?d=. (cell number) I have tried using the
=hyperlink("://ph/l.aspx?d="&d2,d2)

but the website is not updating correctly.
Any help would be great, also if able to do it in vba so I wouldn't need a extra column would be even better
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Hi, if I put 111112 in D2, and then this into E2, it works...

=HYPERLINK("http://google.com/search?q="&D2,D2)

I don't know what your hyperlink is going to, by starting it with a colon looks unfamiliar to me (but I know very little about such networking topics!)

When you say "the website is not updating correctly" - what does that mean?
 
Upvote 0
I can't use another column for a website. I need to use the same website with the addition of the cell data at the end. I really would like a macro to do this and leave the hyperlink in the original column D
 
Upvote 0
Hi, I don't understand what you mean - you can't use another column for a website? You want the hyperlink to exist in a cell, right?

edit: Ahhhhhh, you mean you have the values in cells, and you want to overwrite those values with the corresponding hyperlink?
 
Upvote 0
Try this:

(it assumes your worksheet is called Hyperlinks and that you want to start in D2 and keep going down until you find an empty cell)

VBA Code:
Sub CreateHyperlinks()

Dim shtLinks As Worksheet, rngCell As Range
Const strAddress As String = "http://ph/l.aspx?d="

Set shtLinks = Worksheets("Hyperlinks")
Set rngCell = shtLinks.Range("D2")

Do Until IsEmpty(rngCell.Value) = True

    shtLinks.Hyperlinks.Add Anchor:=rngCell, Address:=strAddress & rngCell.Value
    Set rngCell = rngCell.Offset(1, 0)
    
Loop

End Sub
 
Upvote 0
It's a skill in itself to explain clearly what you actually want to happen ;)
 
Upvote 0

Forum statistics

Threads
1,214,795
Messages
6,121,624
Members
449,041
Latest member
Postman24

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top