By Allen Wyatt for Excel.Tips.Net
Displaying Images based on a Result in Excel
Dave has a large database that he keeps in an Excel workbook. It consists of material samples, and he uses the VLOOKUP function to generate various forms and reports. Dave wants to include a bitmap image on the form that changes according to one of the variables. For instance, if the form is describing an apple, then Dave wants a picture of an apple to appear; if describing a pear, then a pear should appear; and so on.
This is certainly a challenging task, but it is one that can surprisingly be done without macros. The steps are involved, but not that difficult to perform once you get to it:
1. On a new worksheet, select a cell (such as cell B4).
2. Enter the name “apple” into the Name box, to the left of the Formula bar. This defines the name “apple” to refer to cell B4.
3. With cell B4 still selected, display the Insert tab of the ribbon and use the Picture tool to insert the picture of the apple.
4. Enlarge the width and height of cell B4 so that the picture of the apple is contained entirely within the cell.
5. Repeat steps 1 through 4 for each of your other pictures, placing each picture in a different cell and naming them according to the contents of the picture. (For the sake of this example, I’ll assume that “pear” is cell D4 and “orange” is cell F4.)
This post appears with permission from Allen Wyatt and Excel.Tips.Net.
768 total views, 1 views today