|
Microsoft Office Application Development
|
|
Showing a picture from a list of picturesIntroductionMany people keep part lists in Excel. Sometimes even with embedded pictures next to the part data. This article demonstrates a method to show a picture on a sheet that changes when a different part number is chosen from the list of available part numbers. Preparing the listThe first thing to do is to position the pictures properly. Each picture should go in a cell on the same row as a unique description (part number) of the part it pertains to. Format the cells, so the picture fits in a single cell (either adjust the
size of the picture, or adjust row height and column width): Preparing the sheet that shows the dynamic pictureWe need some way of knowing which picture is to be shown. We start off by defining a dynamic range name that will expand automatically when we add new items to our list (assuming they are on Sheet1, starting on cell A1, with one row of headings) Choose Insert, name define and define this name:
Let us say cell A2 on sheet2 will be used to enter the picture code we want to see the picture from. The formula in the next defined name will point to the cell to the right of the cell who's picture name matches the text entered in cell Sheet2!A2:
Creating the dynamic pictureSelect the cell with the topmost picture. Hold down the shift key and click the Edit menu. It should show "Copy Picture...":
Figure 2, screenshot showing part of Excel's Edit menu when clicked whilst holding down the shift key. Select "As shown on screen" from the next dialog and click OK. Now navigate to the cell (on Sheet2 in this example) where you want to show
the dynamic picture and hit the paste button (or control-v): Figure 3, screenshot showing the pasted picture.
Figure 4, screenshot showing the pasted picture's formula bar.
To simplify the selection of the picture description, we can use Data, validation:
Now you can select from the available picture descriptions:
And we're done! DownloadClick here to download a sample file. Other solutionsBernie Deitrick came up with this nice sheet, which handles more pictures, but uses VBA FeedbackSince you have managed to reach the end of this article, maybe you would care to write me a small message, expressing your opinion on this article? Click here to write an email message to me (Maybe I'll add a feedback page with the feedback I get). | ||||||||||||||||||||||||||||||||||||||||
|
Use the contact page to issue
questions or comments about this website. |