Mikeymike_W
Board Regular
- Joined
- Feb 25, 2016
- Messages
- 171
Hi there,
I was wanting to clear all of the activex objects on my sheet but am unsure how to do it.
I tried the code below but it doesn't work. Currently i am using textboxes and comboboxes but thought it would be good to cover radiobuttons and checkboxes too just in case they're added later.
Thanks in advance for any help you can give,
Mike
I was wanting to clear all of the activex objects on my sheet but am unsure how to do it.
I tried the code below but it doesn't work. Currently i am using textboxes and comboboxes but thought it would be good to cover radiobuttons and checkboxes too just in case they're added later.
Thanks in advance for any help you can give,
Mike
VBA Code:
Dim oCtrl As Control
For Each oCtrl In ActiveSheet.OLEObjects
Select Case TypeName(oCtrl)
Case "TextBox", "ComboBox"
oCtrl.Value = ""
Case "OptionButton"
oCtrl.Value = False
End Select
Next oCtrl