Clicking slicers is hiding shapes, how to solve?

thousand

New member
Joined
Apr 2, 2017
Messages
30
Reaction score
0
Points
0
Excel Version(s)
2010
I have a workbook with slicers and shapes, the below works perfectly to hide and unhide the shapes

However, when the slicer is clicked it will also trigger the macro (hide and unhide shapes) is there any clever way to solve this?

Thanks :)


Code:
Sub instructions()
Dim obj As Shape
Set obj = ActiveSheet.Shapes("Oval callout 1")
If obj.Visible Then
    obj.Visible = False
Else
    obj.Visible = True
End If
End Sub
 
Last edited by a moderator:
Back
Top