Solved

Excel Hyperlinks

Posted on 2012-03-10
2
394 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Outlook Free & Paid Tools
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now