Clive
Clive

Reputation:

Dynamic hyperlink using formula

I need to use an ID in a URL hyperlink like this example:

http://www.wotnots.co.uk/property/images/property2402_image1.jpg

The ID here is 2402. I want to change it to the ID number which is in the first column and is different on every row. I want to have the ID number to be the same as the number in the hyperlink.

Upvotes: 0

Views: 315

Answers (3)

Ken Paul
Ken Paul

Reputation: 5765

I would use the HYPERLINK cell function to generate the link. For example:

Cell A2: 2402
Cell B2: =HYPERLINK("http://www. ... /property" & A2 & "_image1.jpg","Click to see ...")

You can then copy the formula into all of the following rows, and the reference to cell A2 will change to be relative to the current row.

This can also be generated dynamically using VBA code if necessary.

Upvotes: 3

lc.
lc.

Reputation: 116448

Try the following formula:

="http://www.wotnots.co.uk/property/images/property"&A1&"_image1.jpg"

Upvotes: 1

Adam Lerman
Adam Lerman

Reputation: 3399

Here you go.

=Concatenate("http://www.wotnots.co.uk/property/images/property",$A1,"_image1.jpg ")

Upvotes: 1

Related Questions