hipster318
New Member
- Joined
- Apr 17, 2009
- Messages
- 1
Hello,
Newbie here (as well as to VBA). Went to http://www.mcgimpsey.com/excel/lookuppics.html , which works great when only wanting to display one image on the worksheet (based on a cell value). However, what if I wanted to display multiple images based on this cell value? Not sure how to change the original code.
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("F1")
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
For example, what if I also wanted to display a different image in cell "H1"?
Any help would be appreciated.
THanks!
Newbie here (as well as to VBA). Went to http://www.mcgimpsey.com/excel/lookuppics.html , which works great when only wanting to display one image on the worksheet (based on a cell value). However, what if I wanted to display multiple images based on this cell value? Not sure how to change the original code.
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("F1")
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
For example, what if I also wanted to display a different image in cell "H1"?
Any help would be appreciated.
THanks!