This example uses a for each loop so that each check box name does not have to be explicitly written out. This is useful when you are adding more control and limit the amount of code you are writing.

Better Method
Dim ctrl As Control
Sub ClearAllButton_Click()
For Each ctrl In exportFilesUF.Controls
If TypeName(ctrl) = "CheckBox" Then
ctrl.Value = True
End If
Next
End Sub
Private Sub SelectAllButton_Click()
For Each ctrl In exportFilesUF.Controls
If TypeName(ctrl) = "CheckBox" Then
ctrl.Value = False
End If
Next
End Sub
Worse Method
Sub ClearAllButton_Click()
CheckBox4.Value = True
CheckBox9.Value = True
CheckBox10.Value = True
CheckBox11.Value = True
CheckBox12.Value = True
CheckBox7.Value = True
CheckBox8.Value = True
CheckBox6.Value = True
CheckBoxCNC_all.Value = True
CheckBox_CNCNodes.Value = True
CheckBox_CNCBeams.Value = True
CheckBox_CNCPanels.Value = True
End Sub
Private Sub SelectAllButton_Click()
CheckBox4.Value = False
CheckBox9.Value = False
CheckBox10.Value = False
CheckBox11.Value = False
CheckBox12.Value = False
CheckBox7.Value = False
CheckBox8.Value = False
CheckBox6.Value = False
CheckBoxCNC_all.Value = False
CheckBox_CNCNodes.Value = False
CheckBox_CNCBeams.Value = False
CheckBox_CNCPanels.Value = False
End Sub