Clearing Option Buttons

P

pdaws

I have four option buttons on a form that are not grouped. I would like to
be able to clear the buttons so that the user can select the appropriate
option button. I would also like to have all of the option button cleared
when the formed is reopened. This is not an active x control, but a from
control. I have tried different codes from the various discussions and none
of them address my particular issue. Please help.
 
H

Harald Staff

Hi

Assuming your Form is a worksheet, in fact assuming the very first
worksheet:

Sub ClearEm()
Dim i As Long
For i = 1 To Sheets(1).OptionButtons.Count
Sheets(1).OptionButtons(i).Value = False
Next
End Sub

HTH. Best wishes Harald
 
P

pdaws

Thanks Harold for the reply, but I tried it and it did not work. I put the
code at the end of the other codes of the option buttons and yes it is a
worksheet and it is worksheet 3.
 
H

Harald Staff

Ok, so either put it on worksheet 1 instead, or alter the code a little.

Hint: Look for the 1's

HTH. Best wishes Harald
 

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

Top