Popup Image when the cell value is equal to part of the filename

yongshun

New Member
Joined
Feb 4, 2018
Messages
2
I have few hundred data (product ID) and I have graphs for each of the data.
I saved these graphs as png in a designated folder.
The filename for the graph is "productID1 - productID2" because I wish to compare the data for 2 products.
I wish to use VBA code to popup the image when I click on the cell even the cell contain productID1 only.
Can anyone help me?
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
This is a large multi-part solution. Nobody wants to write the whole thing for you. You're going to have to get started and let us know when you get stuck.

My recommendation:
Use a VBA form and not worksheet objects. It's endlessly more difficult to work with worksheet objects because their ID changes. It's impossible to reference them.

Here is the basic outline of how I would do it:
1. Worksheet_SelectionChange event on the sheet with your product ID
2. Detect if the cell clicked is in the product ID column, if yes:
3. Open the VBA form object.

Then within the Form Object code:
1. Load the picture in to the form dynamically based on the selected cell
 
Upvote 0

Forum statistics

Threads
1,223,898
Messages
6,175,274
Members
452,628
Latest member
dd2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top