Is there an easy way for a VBA NOVICE (barely understand what I'm doing) to clear all the boxes on a form?
I have 2 simple forms. Each has several Checkboxes, Option Buttons and List Boxes.
How can I put a button on each form to clear all the boxes?
On another forum I found this sub that does work, but only for CheckBoxes...is there a way to make it also work for Option Buttons and List Boxes all in one go?
Sub Clear_Checkbox()
Dim box As OLEObject
For Each box In ActiveSheet.OLEObjects
If TypeName(box.Object) = "OptionButton" Then
box.Object.Value = False
End If
Next box
End Sub
Advice appreciated...please make it simple. THANK YOU!
I have 2 simple forms. Each has several Checkboxes, Option Buttons and List Boxes.
How can I put a button on each form to clear all the boxes?
On another forum I found this sub that does work, but only for CheckBoxes...is there a way to make it also work for Option Buttons and List Boxes all in one go?
Sub Clear_Checkbox()
Dim box As OLEObject
For Each box In ActiveSheet.OLEObjects
If TypeName(box.Object) = "OptionButton" Then
box.Object.Value = False
End If
Next box
End Sub
Advice appreciated...please make it simple. THANK YOU!