Thread: Option Buttons
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Option Buttons

First, I would think that since you're getting Yes/No response, it might be
better to use a single checkboxe for each answer--if it's checked, then it's
yes. If not checked, no.

But you could use a macro to turn off the optionbuttons on a worksheet.

Option Explicit
Sub testme()

Dim OptBTN As OptionButton
Dim OLEObj As OLEObject

For Each OptBTN In ActiveSheet.OptionButtons
OptBTN.Value = xlOff
Next OptBTN

For Each OLEObj In ActiveSheet.OLEObjects
If TypeOf OLEObj.Object Is msforms.OptionButton Then
OLEObj.Object.Value = False
End If
Next OLEObj

End Sub

The OptBTN stuff relates to optionbuttons from the Forms toolbar.

The OLEObj stuff relates to optionbuttons from the Control toolbox toolbar.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Mike Rogers wrote:

I have a form that has option buttons for answering "Yes" "No" questions.
About 45 sets. Everything works really well but this form may also need to
be printed off and filled in by hand, (and then be entered later). Is there
anyway to have all option buttons read false, as apposed to having one read
true and the other read false for each set, so when it is printed everything
is blank. (Not selected) As it is when printed one or the other has been
selected and is therefore the dot is printed. Thanks for the help!!

Mike Rogers


--

Dave Peterson