Solved

Excel Hyperlinks

Posted on 2012-03-10
2
407 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
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…

728 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