Hi guys.
Im using this code that i get from internet to show a dynamic picture.
Option Explicit
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Pictures.Visible = False
With Range("b6")
For Each oPic In Pictures
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
oPic.Height = .Height
oPic.Width = .Width
Exit For
End If
Next oPic
End With
End Sub
But this way it hides every image on my sheet. There is something i can do to work dynamically only with
the pictures i want?
Maybe create a collection of pictures and work inside it. So instead of ''For each oPic in Pictures'' i use
''For each oPic in MyColletion''
If it is possible, can you help me? Dont know how to create a collection of pictures and add them by name. Thank you.
Im using this code that i get from internet to show a dynamic picture.
Option Explicit
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Pictures.Visible = False
With Range("b6")
For Each oPic In Pictures
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
oPic.Height = .Height
oPic.Width = .Width
Exit For
End If
Next oPic
End With
End Sub
But this way it hides every image on my sheet. There is something i can do to work dynamically only with
the pictures i want?
Maybe create a collection of pictures and work inside it. So instead of ''For each oPic in Pictures'' i use
''For each oPic in MyColletion''
If it is possible, can you help me? Dont know how to create a collection of pictures and add them by name. Thank you.