Remove an inserted picture
The code below inserts picture if a condition is met. My question is, is
there any way to remove the picture if the condition no longer exists?
Sub InsertHoliday()
Dim myPict As Picture
Dim rng
On Error GoTo Error
If range("B58").Value < "" Then
Set rng = range("B18")
End If
If range("C58").Value < "" Then
Set rng = range("C18")
End If
If range("D58").Value < "" Then
Set rng = range("G18")
End If
If range("F1") = "No Picture" Then GoTo NoPicture
With rng
Set myPict = .Parent.Pictures.Insert("C:\Users\Owner\Desktop\Ne w
Years Large.gif")
myPict.Top = .Top
myPict.Left = .Left
End With
Error:
End Sub
|