If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Creating web link with data from multiple cells and a image as the link
I have been trying to figure out how link to a web site using a image.
A1 = www.site.com A2 = 1234 A3 = Muffler A4 = 149.99 A5 = image.gif I would like to Hyperlink the image in A5 linking to http://www.site.com/page.asp?partno=...on=A3&price=A4 I can do the link with text =HYPERLINK("http://" & A28 & "/page.asp?partno=" & B28 & "&description=" & C28 &" &price=" & D28,"click here") and it work's fine, but when I insert a image and use the hyperlink above I get "Can not open the specified file" Any help would be appreciated Thanks James |
#2
|
|||
|
|||
Creating web link with data from multiple cells and a image as the link
James
One way you could do it is to remove the hyperlink from the image and use a macro Sub ImageLink() Dim sAdd As String With ActiveSheet sAdd = "http://www.site.com/page.asp?partno=" & _ .Range("a2").Value & "&description=" & _ .Range("a3").Value & "&price=" & _ .Range("a4").Value .Parent.FollowHyperlink sAdd End With End Sub Assign this macro to the image. I can't think of any way to do it without a macro. -- Dick Kusleika MVP - Excel Excel Blog - Daily Dose of Excel www.dicks-blog.com "James" wrote in message m... I have been trying to figure out how link to a web site using a image. A1 = www.site.com A2 = 1234 A3 = Muffler A4 = 149.99 A5 = image.gif I would like to Hyperlink the image in A5 linking to http://www.site.com/page.asp?partno=...on=A3&price=A4 I can do the link with text =HYPERLINK("http://" & A28 & "/page.asp?partno=" & B28 & "&description=" & C28 &" &price=" & D28,"click here") and it work's fine, but when I insert a image and use the hyperlink above I get "Can not open the specified file" Any help would be appreciated Thanks James |
#3
|
|||
|
|||
Creating web link with data from multiple cells and a image as the link
That works great, thanks for the help.
I also need to make this work for a multiple cells a1, a2, a3....a1000. Is "offset" the right thing to look at instead of calling the cell directly "a1", "b1"... I am searching your site right now. Thanks, James Sub ImageLink() Dim sAdd As String With ActiveSheet sAdd = "http://www.site.com/page.asp?partno=" & _ .Range("a1").Value & "&description=" & _ .Range("b1").Value & "&price=" & _ .Range("c1").Value .Parent.FollowHyperlink sAdd End With End Sub |
#4
|
|||
|
|||
Creating web link with data from multiple cells and a image as the link
James
Yes, offset is probably as good as any. Depending on what you're trying to do, consider using a loop. Dim sAdd As String Dim cell As Range sAdd = http://www.site.com/page.asp?partno= For Each cell In ActiveSheet.Range("A1:A1000") sAdd = http://www.site.com/page.asp?partno= & _ cell.Value & "&description=" & _ cell.Offset(0,1).Value & "&price=" & _ cell.Offset(0,2).Value 'Do stuff with the URL here Next cell -- Dick Kusleika MVP - Excel Excel Blog - Daily Dose of Excel www.dicks-blog.com "James" wrote in message om... That works great, thanks for the help. I also need to make this work for a multiple cells a1, a2, a3....a1000. Is "offset" the right thing to look at instead of calling the cell directly "a1", "b1"... I am searching your site right now. Thanks, James Sub ImageLink() Dim sAdd As String With ActiveSheet sAdd = "http://www.site.com/page.asp?partno=" & _ .Range("a1").Value & "&description=" & _ .Range("b1").Value & "&price=" & _ .Range("c1").Value .Parent.FollowHyperlink sAdd End With End Sub |
Thread Tools | |
Display Modes | |
|
|