A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Links and Linking
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Creating web link with data from multiple cells and a image as the link



 
 
Thread Tools Display Modes
  #1  
Old April 29th, 2004, 05:27 PM
James
external usenet poster
 
Posts: n/a
Default 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  
Old April 29th, 2004, 10:02 PM
Dick Kusleika
external usenet poster
 
Posts: n/a
Default 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  
Old April 30th, 2004, 04:51 PM
James
external usenet poster
 
Posts: n/a
Default 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  
Old April 30th, 2004, 07:08 PM
Dick Kusleika
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:28 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.