Option Buttons

R

Robin Clay

Greetings !

I have several InputBoxes.

I want to input values for four Boolean variables.

I know how to do it with InputBoxes, but "Option buttons"
are a closed book to me.

I would be very grateful if SKS would be so kind as to
give me some so=ample code that I might adapt for my
purpose ?


RClay AT haswell DOT com
 
T

Tom Ogilvy

You want to replace your four input boxes with a userform with 4 option
buttons?

If so, just create a userform. Drag an option button to it and position it.
Repeat to get 4.

Drag a commandbutton on to the userform. Right click on the commandbutton
and select view code

Private Sub Commandbutton1_Click()
me.hide
End Sub

In a general module you could use code like this to show and process the
form.

Sub showform()
Userform1.show
Select Case True
Case OptionButton1.Value
' code for optionbutton1 selected
Case OptionButton2.Value
' code for optionbutton2 selected


Case OptionButton3.Value
' code for optionbutton3 selected

Case OptionButton4.Value
' code for optionbutton4 selected

End Select
Unload Userform1

End Sub
 
R

Robin Clay

I had written:

Tom was kind enough to respond:
You want to replace your four input boxes
with a userform with 4 option buttons?

Do I ?
If so, just create a userform.

Pah !

"Just" create a userform, he says !

I'm lost already, already.... :(


But it was a kind thought, so Thank you, Tom.



RClay AT haswell DOT com
 

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

Similar Threads

Duplicate ToolBar Buttons 6
Icon 2
Status Bar 1
Copying Page SetUp 7
Access to Worksheet in AddIn.xla 3
Place a SHELL Window 3
Positioning a DOS Window 4
Renaming folders 6

Top