View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
crazybass2 crazybass2 is offline
external usenet poster
 
Posts: 167
Default Insert picture when cell changes

Having all the pictures already inserted and in position is a good idea.

I would, however, use the visibility rather than changing the height/width.

The following would accomplish this for 3 pictures.


Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target.Cells, Range("a6")) Is Nothing Then
For Each sh In Shapes
If Left(sh.Name, 7) = "Picture" Then sh.Visible = msoFalse
Next sh
Select Case Target.Value
Case "Pic 1"
Shapes("Picture 1").Visible = msoTrue
Case "Pic 2"
Shapes("Picture 2").Visible = msoTrue
Case "Pic 3"
Shapes("Picture 3").Visible = msoTrue
Case Else
End Select
End If
End Sub



" wrote:

I think I would PROBABLY have ALL the pictures in the cell, one on top
of another - and when the cell is changed set the size of all but one
of them to zero, the other can be set to the normal height/width
- for example - to set Picture2 to invisible
ActiveSheet.Shapes("Picture 2").Select
Selection.ShapeRange.Height = 0#
Selection.ShapeRange.Width = 0#



Rookie_User wrote:
I have read a few posts that come close but maybe some expert can offer a
more definitive solution here. I have a drop down list in cell A6, it is in
the validation list of the cell. I have a variety of pictures that I would
like to insert into that same worksheet when that cell is changed. There is
one picture per value, but I need the picture to insert at the same spot.
Any idea's?


J