Images In Excel

tm1274

Board Regular
Joined
Aug 25, 2005
Messages
77
Is is possible to show an image either in a cell or maybe link to an online image so that when a selection or cell contains a certain value the image will appear? I know that I can place an image within a comment box but it does not look very professional.
 

Some videos you may like

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

tm1274

Board Regular
Joined
Aug 25, 2005
Messages
77
Thanks for your reply. That is not quite what I am looking for. I searched the boards for some time and came across this post:

http://www.mrexcel.com/board2/viewtopic.php?t=57281&highlight=image

at the bottom there's a zip file with a sheet that looks like what I want to do but I can not understand how he made this work. What I need to do is make the image change based upon a cells value like A1 with a value of 1 might be cause a picture of an apple to appear, if the value of cell A1 were to be 2 it would cause an image of an orange. Can anyone tell me how to do this like they did in the previous post zip fle?
 

Damon Ostrander

MrExcel MVP
Joined
Feb 17, 2002
Messages
4,239
Hi again tm1274,

Yes, the method demonstrated by the zip file is very clever and should work well for you if you only have a few (pictures to choose from). If you have a lot--say more than four or five, this starts to get unwieldy because the formula used to define the picture assigned to the name gets long and complicated. There are two things you should look at in that example, the first is the second sheet (Pictures) which has all the pictures on it, and they are named (select each one an look at the Name box just above cell A1) and placed in cells A1, B1 and C1. The other is the formula assigned to the name PictureReference which is used in the formula assigned to the picture on Sheet1. Go to Insert > Name > Define and look at the formula assigned to PictureReference. You must replace this formula with a similiar formula that yields the cell containing the appropriate picture based on the value of the cell on the main sheet.

The VBA-based approach is much more flexible and can easily handle almost any number of pictures. This method works well with numbers, text strings, etc., to identify the picture that should appear. It becomes really easy if you can name the picture the same as the text string in the cell, so also works easily with large dropdown lists.

In addition, it doesn't require another sheet to store the pictures on--they can be stored invisibly on the sheet you want them to appear on, positioned right where you want them to appear. Perhaps the following posting will help if you want to use this method:

http://www.mrexcel.com/board2/viewtopic.php?t=135205&highlight=pictures

Keep Excelling.

Damon
 

Watch MrExcel Video

Forum statistics

Threads
1,113,859
Messages
5,544,708
Members
410,630
Latest member
Maggie28
Top