Welcome toExcel.Tips.Net
Tips.Net Home
ExcelTips Home
Ask an Excel Question
Make a Comment
ExcelTips FAQ
ExcelTips Premium
Learn Access Now
Free Printable Forms
Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Legal Tips
Money Tips
Organizing Tips
Pest Tips
Pet Tips
Wedding Tips
Word2007 Tips
WordTips
Advertise on the
ExcelTips Site
Adding a Little Animation to Your Life
Converting a Range of URLs to Hyperlinks
Making the Formula Bar Persistent
Dave has a large database that he keeps in an Excel workbook. It consists of material samples, and 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:
=IF(G1=1,"apple",IF(G1=2,"pear",IF(G1=3,"orange","")))
It is important that the formula reference the names exactly as you defined them in step 2 for each fruit's picture. For the sake of this example, I'll assume that you entered this formula in cell A1 of Sheet1.
=INDIRECT(Sheet1!$A$1)
Now, whenever the fruit name in cell A1 changes (which is, in turn, based on the value in cell G1), the image will change.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (3128) applies to Microsoft Excel versions: 97 2000 2002 2003
More Power! For some people, the prospect of creating macros can be scary. Those who conquer their fears, however, find they become much more confident and productive once they learn how to make Excel do exactly what they want. ExcelTips: The Macros is an invaluable source for learning Excel macros. You are introduced to the topic in bite-sized chunks, pulled from past issues of ExcelTips. Learn at your own pace, exactly the way you want.