option buttons

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I need some help on option buttons and tick boxes that I have on an Excel
worksheet. I have a button which I would like to run a macro which will
'refresh' the form so that any selections made are unselected but i can't
figure out how to do this option boxes and tick boxes. Can anyone please
help?

Gina
 
Forms toolbar controls or Control Toolbox Toolbar controls?

for the latter

for each obj in Activesheet.OleObjects
if typeof obj.Object is MSforms.OptionButton or _
typeof obj.Object is MSforms.Checkbox then
obj.Object.Value = False
end if
Next


for forms controls

Sub ABCDEF()
Dim cbx As CheckBox, obtn As OptionButton
For Each cbx In ActiveSheet.CheckBoxes
cbx.Value = xlOff
Next
For Each obtn In ActiveSheet.OptionButtons
obtn.Value = xlOff
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top