ExcelBanter

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

dayton

Option Buttons
 
How do I make sure that one of my two buttons have been selected before the
rest of my code exectues.


If OptionButton1 "NOT SELECTED" and OptionButton2 "NOT SELECTED" then
MsgBox "Make Selction".....
Else
'Execute statements

End If




Hawkide

Option Buttons
 
If OptionButton1 = True Or OptionButton2 = True Then
'Execute statements
Else
MsgBox "Make a selection"
End If

"Dayton" wrote:

How do I make sure that one of my two buttons have been selected before the
rest of my code exectues.


If OptionButton1 "NOT SELECTED" and OptionButton2 "NOT SELECTED" then
MsgBox "Make Selction".....
Else
'Execute statements

End If





Dale Preuss[_2_]

Option Buttons
 
Dayton,

If this is on a form, disable the comand button that executes "the rest of
your code". When an option button is clicked, enable the command button.
Please note, the command button may lose it's "Default" status as a result.

Dale Preuss


"Dayton" wrote:

How do I make sure that one of my two buttons have been selected before the
rest of my code exectues.


If OptionButton1 "NOT SELECTED" and OptionButton2 "NOT SELECTED" then
MsgBox "Make Selction".....
Else
'Execute statements

End If





Bob Phillips[_6_]

Option Buttons
 
If Not OptionButton1.Value and Not OptionButton2.Value then
MsgBox "Make Selction".....
Else
'Execute statements
End If

--

HTH

RP

"Dayton" wrote in message
...
How do I make sure that one of my two buttons have been selected before

the
rest of my code exectues.


If OptionButton1 "NOT SELECTED" and OptionButton2 "NOT SELECTED" then
MsgBox "Make Selction".....
Else
'Execute statements

End If







All times are GMT +1. The time now is 12:30 AM.

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