ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Option Buttons (https://www.excelbanter.com/excel-programming/306514-option-buttons.html)

Robin Clay[_3_]

Option Buttons
 

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

Tom Ogilvy

Option Buttons
 
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

--
Regards,
Tom Ogilvy


"Robin Clay" wrote in message
...

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




Robin Clay[_3_]

Option Buttons
 
I had written:
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 sample code that I might adapt for my
purpose ?



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


Tom Ogilvy

Option Buttons
 
See corrected answer to you new posting.

--
Regards,
Tom Ogilvy

"Robin Clay" wrote in message
...
I had written:
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 sample code that I might adapt for my
purpose ?



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





All times are GMT +1. The time now is 12:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com