View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.newusers
Mike at Channel
 
Posts: n/a
Default Insert Picture from dropdown selection

Wonderful. Thank you Cutter, your codes work perfectly. This is exactly how I
wanted it to work. I did make two seperate lists and associated two different
pictures, and now I can select two of the same boats without losing the
picture(even though the point is to compare two different boats). I
definitely need some coding practice, but having someone to point you in the
right direction helps. I would have been lost without the help. Thanks.

Thanks to Ron as well for your approach. My minimal experience with Macros
made the approach a bit more complicated. It kept returning the text name of
the picture instead of the picture itself. I'm sure it had to do with one of
my definitions, or a small error with my code. But thanks for your input as
well.

Mike
"Cutter" wrote:


Try this:

Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("B12")
For Each oPic In Me.Pictures
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Exit For
End If
Next oPic
End With
With Range("C12")
For Each oPic In Me.Pictures
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Exit For
End If
Next oPic
End With
End Sub

Make sure you change the formula in C12 to refer to the drop down list
in C11

And you'll have to do something to your lists so that the name for the
picture already showing (from one list selection) does not show up in
the other. This is because each picture can only be shown once. I
think you'll have to have 2 lists.


--
Cutter
------------------------------------------------------------------------
Cutter's Profile: http://www.excelforum.com/member.php...fo&userid=9848
View this thread: http://www.excelforum.com/showthread...hreadid=513797