Hi!
If I want to show several pictures/images in Excel, were every picture/image is based on different cell (one macro for each picture), how will the VBE code be?
Example; If I have a list of several job positions and a list of several people to fill into these positions, and when I chose Person 1 in position 1, a picture of person one should show, when I chose Person 2 in position 2, a picture of person two should show, etc.. So then the sheet would show all the people in the different positions... Is this possible to do?
Hope someone could help me on this..
PS; I am not a programmer so you most likely have to explain it to me on a basic level..
Thanks!!
Hi,
Take a look at Jim's very nice solution ...
http://www.mcgimpsey.com/excel/lookuppics.html
HTH
Hi Jean,
Thanks for the answer!
I have actually tried this soultion, but it only works with one picture "at the time"... I tried to copy several of this this macro into the same VBE, but how do I manage make each macro work on one particular cell..? I got an error message which sound like; "Ambiguous name detected: Worksheet_Calculate"... How can I separate these macro so it can dispaly several pictures "at the same time"..?
Hi, Try this:-
Example:- Place some names in column "A". In column "B" next to the names place the pictures, (Make sure the top left corner of the picture is in the Column "B" cell).
Right click your sheet Tab , Select "View Code" , VB Window appears.
Paste the code below into the VB Window.
Close the VB Window..
To Hide the Picture, Click on the Name in Column "A" next to the Picture.
To show the Picture click the Named Cell again.
Regards MickPrivate Sub Worksheet_SelectionChange(ByVal Target As Range) Dim Pic As Shape For Each Pic In ActiveSheet.Shapes If Pic.Type = msoPicture Then If Target.Offset(, 1).Address = Pic.TopLeftCell.Address Then If Pic.Visible = True Then Pic.Visible = False Else Pic.Visible = True End If End If End If Next Pic End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks