You can get them all visible/hidden with:
Option Explicit
Sub test01()
ActiveSheet.GroupBoxes.Visible = False
End Sub
Or you could cycle through all the groupboxes:
Sub test02()
Dim GBox As GroupBox
For Each GBox In ActiveSheet.GroupBoxes
GBox.Visible = False
Next GBox
End Sub
Or you could go through the shapes collection
Sub test03()
Dim myShape As Shape
For Each myShape In ActiveSheet.Shapes
If myShape.Type = msoFormControl Then
If myShape.FormControlType = xlGroupBox Then
myShape.Visible = False
End If
End If
Next myShape
End Sub
And if you had some you want visible and some hidden, you could use their names:
ActiveSheet.GroupBoxes("group box 1").Visible = False