G
Guest
Hi,
I've used the code / formula's in the below link to make pictures
appear/disappear depending on a selection made by a dropdown.
http://www.mcgimpsey.com/excel/lookuppics.html
It works great. However, the VB code instructs all pictures on the
spreadsheet to disappear. I have pictures on the spreadsheet other than those
I need to appear/disappear.
For example if I have two pictures (PPic1 & PPic2) how do i get these to
remain visible while still allowing the formula to work.
I know i need to change/add something to the VB code - but I'm not sure
what. I've included the code below. Any help would be great.
Cheers
Phil
Private Sub Worksheet_Calculate()
Dim oPic As Picture
With Range("B5")
For Each oPic In Me.Pictures
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Else
oPic.Visible = False
Exit For
End If
Next oPic
End With
End Sub
I've used the code / formula's in the below link to make pictures
appear/disappear depending on a selection made by a dropdown.
http://www.mcgimpsey.com/excel/lookuppics.html
It works great. However, the VB code instructs all pictures on the
spreadsheet to disappear. I have pictures on the spreadsheet other than those
I need to appear/disappear.
For example if I have two pictures (PPic1 & PPic2) how do i get these to
remain visible while still allowing the formula to work.
I know i need to change/add something to the VB code - but I'm not sure
what. I've included the code below. Any help would be great.
Cheers
Phil
Private Sub Worksheet_Calculate()
Dim oPic As Picture
With Range("B5")
For Each oPic In Me.Pictures
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Else
oPic.Visible = False
Exit For
End If
Next oPic
End With
End Sub