Using Formula to show if specific Option box is True

Pistoleiro

New Member
Joined
Nov 18, 2008
Messages
34
Hi All,


I'm not to sure about this one as I use option boxes fairly infrequently. My challenge is this
1) I have 2 option boxes showing an enabled disabled setting
2) I would rather not have these linked to a cell.
3) I would like to find whether 1 of these option boxes is true or false using a formula

Anyone with any ideas on how to do this. I'm as stuck as a pig in a sand pit.


Thanks very much
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Hi,

I'm not really sure what your after but would something like this work?

In standard Module

Code:
Function OptionButtonCheck()

    With Sheets("sheet1")
        If .OptionButton1.Value = True Then
            OptionButtonCheck = .OptionButton1.Caption
        Else
            OptionButtonCheck = .OptionButton2.Caption
        End If
    End With
    
    Application.Volatile
    
End Function

In the sheet that contains the bottons code module

Code:
Private Sub OptionButton1_Click()

Calculate

End Sub

Private Sub OptionButton2_Click()

Calculate

End Sub

You would call this function using:

=OptionButtonCheck()
 
Last edited:
Upvote 0
Sorry, it's not possible with a formula using built-in functions. You would need some VBA code. Where are your OptionButtons from?
 
Upvote 0
Aye, the correct method is to link to a cell however I was hoping for something where it wouldn't be necessary to change any protection that I've already coded in to the worksheet events. As the spreadsheets are setup with a certain amount of security, I guess unlocking that particular cell shouldn't cause too many problems.

I've changed it to link to a cell with data validation ensuring it can only ever be one of the two values.

Thanks for your help with this. I thought it was not possible by using built in formula's. Doesn't hurt to try and get around it though ;). Thanks again all.
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top