View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Should be simple: Lookup a picture from a folder based on a cell value changing

One way is to put an image control on your WS, sized to the correct
dimensions.
Set its .PictureSizeMode to 3 - fmPictureSizeModeZoom.

Then in that WS_Change event:

If not intersect(target,<YourRange) Is nothing then
Image1.Picture = LoadPicture(Target.Text)
'...etc

You should add error handling in case the graphic does not exist/can't load.

NickHK

"Finny388" wrote in message
oups.com...
I saw
http://www.mcgimpsey.com/excel/lookuppics.html
but where did he keep his pictures?

I just want to show a picture bases on a cell value that is equal to
the name of the jpg in a folder.

When the cell (A1) changes its value, a lookup show the jpg with the
same text of the value.

Change A1 to "Picture5" and C:\Pictures\Picture5.jpg shows up in C1.

bonus: the picture sized to the size of the C1 cell without losing its
aspect ratio

Thanks!