Hello friends, hope all is well!
Please help me with the code here.
The code is built to show the pictures based on what is typed in D4.
Trouble is that when D4 is 0 or empty or has 1 space, the pictures are NOT disappearing.
I cant figure it out & Thanks a lot in advance!
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error GoTo Terminate
Call HideEachShape
If Not Intersect(Target, Range("D4")) Is Nothing Then
If Range("D4").Value = "" Then Call HideEachShape
Call HideEachShape
Select Case Sheets("Report").Range("D4").Value
Case Sheets("Report").Range("D4").Value
Sheet2.Shapes(CStr(Sheets("Report").Range("D4").Value)).Visible = True
'Sheet2.Shapes("7").Visible = True
End Select
End If
Exit Sub
Terminate:
Call HideEachShape
End
End Sub
Sub ShowEachShape()
Dim sObject As Shape
For Each sObject In ActiveSheet.Shapes
sObject.Visible = True
Next
End Sub
Sub HideEachShape()
Dim sObject As Shape
For Each sObject In ActiveSheet.Shapes
sObject.Visible = False
Next
End Sub
Bookmarks