Solved

Excel Hyperlinks

Posted on 2012-03-10
2
401 Views
Last Modified: 2012-03-11
Hi Guys
I am using Excel 2003
I have this order-form on an Excel spreadsheet (see image attachment)
I would like to enable a user to view the image of a selected item.
Images are available my website www.mywebsite.com
The user is supposed to select the 'item_no' cell and click a button labeled 'View-Image' (see attached cell B9 is selected)

Image url is "http://www.mywebsite.com/images/" + ltrim(Str(ActiveCell.value))+".jpg"
I would like the code for the click event for the View-Image button to produce a webpage with the selected item image.
Is this senario workable?
If yes what should be the code of the 'on_click' event for the View-Image Button?
I was experimenting but could not get it to work.
Your help is appreciated.
Thanks
Dory
Ssheet-image.jpg
0
Comment
Question by:dory550
2 Comments
 
LVL 18

Accepted Solution

by:
Curt Lindstrom earned 500 total points
ID: 37705927
Try something like this
Sub View_Image_Click()

    ActiveCell.Select
    With Worksheets(1)

    .Hyperlinks.Add .Range("Q16"), "http://www.mywebsite.com/images/" + LTrim(Str(ActiveCell.Value)) + ".jpg"
    End With
    Range("Q16").Select
    Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
End Sub

Open in new window

Q16 can be changed to any cell you want in the spreadsheet hidden from the user.

Test in attached file

Curt
View-Image.xls
0
 

Author Closing Comment

by:dory550
ID: 37706585
epaclm:
It worked like a charm
Thank you for your help
Dory
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show you how to use shortcut menus in the Access run-time environment.
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question