Excel 5/95 대화 시트에서는 컬렉션의 컨트롤을 반복하여 컨트롤 컬렉션의 값 / 내용을 변경할 수 있습니다. 다음과 같이 : For Each cb In dlg.CheckBoxes.

Excel 97 이상에서는 UserForm 개체가 같은 방식으로 컨트롤을 그룹화하지 않습니다.

아래에는 여러 UserForm 컨트롤의 값 / 내용을 변경하는 방법을 보여주는 몇 가지 매크로 예제가 있습니다.

Sub ResetAllCheckBoxesInUserForm()

Dim ctrl As Control

For Each ctrl In UserForm1.Controls

If TypeName(ctrl) = "CheckBox" Then

ctrl.Value = False

End If

Next ctrl

End Sub

Sub ResetAllOptionButtonsInUserForm()

Dim ctrl As Control

For Each ctrl In UserForm1.Controls

If TypeName(ctrl) = "OptionButton" Then

ctrl.Value = False

End If

Next ctrl

End Sub

Sub ResetAllTextBoxesInUserForm()

Dim ctrl As Control

For Each ctrl In UserForm1.Controls

If TypeName(ctrl) = "TextBox" Then

ctrl.Text = ""

End If

Next ctrl

End Sub