ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   optionbutton - three options (https://www.excelbanter.com/excel-discussion-misc-queries/171662-optionbutton-three-options.html)

Sian

optionbutton - three options
 
I have optionbuttons 'Pass' and 'Fail'. Using conditional formatting one
turns the adjacent cell green and the other red (ie condition is 'if the
optionbutton-linked cell contains TRUE turn green, if FALSE turn red')
Users being users, someone will click an optionbutton by mistake before the
test has been run. I want to add a third optionbutton 'Not Tested' which
will reset the adjacent cell colour.
So I either need a way to return, say, a number from my optionbuttons rather
than TRUE/FALSE or some other way round it. Is the key the TripleState
property? Does anyone have any ideas?
The worksheet can potentially contain results for hundreds of tests so I
REALLY don't want to start writing code. It's big enough as it is.
Ideas greatly appreciated! Sian

Bob Phillips

optionbutton - three options
 
If you have 3 optionbuttons from the forms toolbar, all linked to the same
cell, they will set that value to 1, 2 or 3 depending upon which button is
clicked.

You can test that in your CF.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Sian" wrote in message
...
I have optionbuttons 'Pass' and 'Fail'. Using conditional formatting one
turns the adjacent cell green and the other red (ie condition is 'if the
optionbutton-linked cell contains TRUE turn green, if FALSE turn red')
Users being users, someone will click an optionbutton by mistake before
the
test has been run. I want to add a third optionbutton 'Not Tested' which
will reset the adjacent cell colour.
So I either need a way to return, say, a number from my optionbuttons
rather
than TRUE/FALSE or some other way round it. Is the key the TripleState
property? Does anyone have any ideas?
The worksheet can potentially contain results for hundreds of tests so I
REALLY don't want to start writing code. It's big enough as it is.
Ideas greatly appreciated! Sian




Sian

optionbutton - three options
 
This would work beautifully with the optionbutton from the forms toolbar -
any ideas how to make the group box smaller or the line around it invisible?!
(these little details...)

In testing out your idea, though, I realise that I should be linking my
activex optionbuttons to three different cells (so I get a FALSE/TRUE/FALSE
effect which updates in unison) - so actually you did solve my problem.
Thank you!



Dave Peterson

optionbutton - three options
 
You can hide the groupboxes in code--I don't think that there's any other way.

Hit alt-f11 to get to the VBE
hit ctrl-g to see the immediate window
type this and hit enter.

activesheet.groupboxes.visible = false

If you only want to hide a single groupbox, you can use something like:

activesheet.groupboxes("group box 1").visible = false



Sian wrote:

This would work beautifully with the optionbutton from the forms toolbar -
any ideas how to make the group box smaller or the line around it invisible?!
(these little details...)

In testing out your idea, though, I realise that I should be linking my
activex optionbuttons to three different cells (so I get a FALSE/TRUE/FALSE
effect which updates in unison) - so actually you did solve my problem.
Thank you!


--

Dave Peterson

Bob Phillips

optionbutton - three options
 
Why use a group box?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Sian" wrote in message
...
This would work beautifully with the optionbutton from the forms toolbar -
any ideas how to make the group box smaller or the line around it
invisible?!
(these little details...)

In testing out your idea, though, I realise that I should be linking my
activex optionbuttons to three different cells (so I get a
FALSE/TRUE/FALSE
effect which updates in unison) - so actually you did solve my problem.
Thank you!





Sian

optionbutton - three options
 
Well, don't I need a group box to keep my Forms optionbuttons in sets of
three, rather than all interacting with each other?
Or will different linked cells do this? Off to try it now...

"Bob Phillips" wrote:

Why use a group box?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Sian" wrote in message
...
This would work beautifully with the optionbutton from the forms toolbar -
any ideas how to make the group box smaller or the line around it
invisible?!
(these little details...)

In testing out your idea, though, I realise that I should be linking my
activex optionbuttons to three different cells (so I get a
FALSE/TRUE/FALSE
effect which updates in unison) - so actually you did solve my problem.
Thank you!






Dave Peterson

optionbutton - three options
 
If you have multiple sets of optionbuttons, you'll want the groupboxes.

It wasn't clear (to me, at least) that you had multiple sets.

Sian wrote:

Well, don't I need a group box to keep my Forms optionbuttons in sets of
three, rather than all interacting with each other?
Or will different linked cells do this? Off to try it now...

"Bob Phillips" wrote:

Why use a group box?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Sian" wrote in message
...
This would work beautifully with the optionbutton from the forms toolbar -
any ideas how to make the group box smaller or the line around it
invisible?!
(these little details...)

In testing out your idea, though, I realise that I should be linking my
activex optionbuttons to three different cells (so I get a
FALSE/TRUE/FALSE
effect which updates in unison) - so actually you did solve my problem.
Thank you!






--

Dave Peterson

Bob Phillips

optionbutton - three options
 
Nor me, it seemed like just the three.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Dave Peterson" wrote in message
...
If you have multiple sets of optionbuttons, you'll want the groupboxes.

It wasn't clear (to me, at least) that you had multiple sets.

Sian wrote:

Well, don't I need a group box to keep my Forms optionbuttons in sets of
three, rather than all interacting with each other?
Or will different linked cells do this? Off to try it now...

"Bob Phillips" wrote:

Why use a group box?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"Sian" wrote in message
...
This would work beautifully with the optionbutton from the forms
toolbar -
any ideas how to make the group box smaller or the line around it
invisible?!
(these little details...)

In testing out your idea, though, I realise that I should be linking
my
activex optionbuttons to three different cells (so I get a
FALSE/TRUE/FALSE
effect which updates in unison) - so actually you did solve my
problem.
Thank you!






--

Dave Peterson





All times are GMT +1. The time now is 02:17 AM.

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