Question : Hide/Unhide Objects through VBA

I am looking for a way to reference objects on my excel sheet I tried a few variations of:
Object("NegativeArrow").Visible = False
and I get Function not defined.

What is the best way to accomplish this?

Answer : Hide/Unhide Objects through VBA

Here's how you can loop through all the shapes on the active sheet and hide/unhide as needed:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
Sub LoopThroughAllShapes()

    Dim myShapes As Shape
    
    For Each myShapes In ActiveSheet.Shapes
        Debug.Print myShapes.Name
        myShapes.Visible = msoFalse 'Set to msoTrue to unhide
    Next

End Sub
Random Solutions  
 
programming4us programming4us