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

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
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,223,944
Messages
6,175,553
Members
452,652
Latest member
eduedu

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