ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   OptionButton value (https://www.excelbanter.com/excel-programming/320944-optionbutton-value.html)

Patrick Simonds

OptionButton value
 
I have a group of 3 OptionButtons ( No Lunch, 30 Minutes, 60 Minutes), What
I need is, if Cell 6 of the current row (rng(1, 6) ) is blank then No Lunch
is set, or if 30 then 30 Minutes is set or if it is 60 well you get the
point.



Claud Balls

OptionButton value
 
Private Sub CommandButton1_Click()
If ActiveSheet.Range("A6") = "" Then
OptNoL.Value = True
ElseIf ActiveSheet.Range("A6") = 30 Then
opt30L.Value = True
ElseIf ActiveSheet.Range("A6") = 60 Then
opt60l.Value = True
End If
End Sub



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Bob Phillips[_6_]

OptionButton value
 
You could take another approach, link all 3 buttons to the same cell, say
A1, and add this formula to A1

=IF(F1="",1,IF(F1=30,2,IF(F1=60,3)))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Claud Balls" wrote in message
...
Private Sub CommandButton1_Click()
If ActiveSheet.Range("A6") = "" Then
OptNoL.Value = True
ElseIf ActiveSheet.Range("A6") = 30 Then
opt30L.Value = True
ElseIf ActiveSheet.Range("A6") = 60 Then
opt60l.Value = True
End If
End Sub



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!





All times are GMT +1. The time now is 03:43 AM.

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