Clearing Option Buttons

D

Dave Peterson

Is the questionaire a UserForm or a worksheet nicely formatted?

If on a worksheet, are the option buttons from the controltoolbox toolbar or
from the forms toolbar?

Do you have linked cells that you can set to False or clear?

Are you looking for a way to do this via code?
 
R

Rod

This is a worksheet that is formatted with 56 questions
and five option buttons for each question from which to
choose a response.

The option buttons were placed from the forms tool bar and
then grouped by the fives response choices.

I don't understand about the linked cells being set to
False or clear. I thought perhaps there was a VB line or
sot that could be written that would clear all 280 (5X56)
buttons at one time.

Thanks for any help you can give.
 
D

Dave Peterson

If you rightclick on an optionbutton within a group, you can choose
Format Control|Control Tab

There's an option for Cell Link.

You can assign a different cell for each group of option buttons.

This linked cell would tell you which option was selected: 1 through 5 in your
case.

If you set the linked cell to 0 (or just clear it), you can get rid of the
selected options.

But if you want a macro approach, you could run this:

Option Explicit
Sub testme()
ActiveSheet.OptionButtons.Value = xlOff
End Sub

It'll clear all the optionbuttons on the worksheet.

Maybe you could add a button from the forms toolbar with a nice "Click here to
clear all choices" caption.

Option Explicit
Sub testme()
Dim resp As Long

resp = MsgBox(prompt:="Are you sure?", Buttons:=vbYesNo)
If resp = vbYes Then
ActiveSheet.OptionButtons.Value = xlOff
End If
End Sub

That's a lot of buttons to clear without confirmation.
 

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