Hello, I am trying to use the following codes to hide/show shapes on a worksheet. The weird thing is that the code for the rectangles is working perfectly, but the code for the ovals does not. I have confirmed that the shapes are "ovals" so I am at a loss as to why it will not hide the ovals. I appreciate any insights - thanks,
VBA Code:
Sub ToggleEmergencyLights()
Dim shp As Shape
Sheets("Device Map").Activate
For Each shp In Sheets("Device Map").Shapes
If shp.Type = msoShapeRectangle Then
If shp.Name Like "*Rectangle*" Then
If shp.Visible Then
shp.Visible = False
Else
shp.Visible = True
End If
End If
End If
Next
End Sub
VBA Code:
Sub ToggleFireExtinguishers()
Dim shp As Shape
Sheets("Device Map").Activate
For Each shp In Sheets("Device Map").Shapes
If shp.Type = msoShapeOval Then
If shp.Name Like "*oval*" Then
If shp.Visible Then
shp.Visible = False
Else
shp.Visible = True
End If
End If
End If
Next
End Sub