Open image XXXX.png where XXXX is the cell value?

Viceman

New Member
Joined
Sep 8, 2011
Messages
9
What is the simpliest way to open up an image from specified folder. Where image name is cell value by clicking the cell.

For example:
I have 0123 value in A1 cell. And subfolder \pics\ in my work folder and there is a 0123.png file in pics folder. So How I can open this image by clicking the cell. I know I can do this with hyperlink for example, but if put 0124 value in A1 cell I want it to open 0124.png file then. So I can also easily copy the macro (or whatever) for other cells also.
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Hi, as a starting point:
Code:
 Sub Pic_insert() path = "c:\temp\" '<<<< adopt 'Picture-Name in A2 i = 2     ActiveSheet.Shapes.AddPicture cells(i,1) & ".png", -1, -1, 60, 60, 400, 300 End Sub
regards
 
Upvote 0
I don't know why, but for some reason I dont get it to work before I put full folder path into that link :confused:
 
Upvote 0
Well yes, of course the full path information needs to be there, but you have not provided that information in your question (I do not know what your work folder is).
 
Upvote 0

Forum statistics

Threads
1,226,104
Messages
6,188,956
Members
453,513
Latest member
biovio

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