ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Allow selection of only 1 checkbox (https://www.excelbanter.com/excel-discussion-misc-queries/161621-allow-selection-only-1-checkbox.html)

Les Linton

Allow selection of only 1 checkbox
 
I am modifying a paper document to be used electronically and trying not to change the "look" of the document.

There are a number of sets of checkboxes (1 to 4)where only one is to be selected.

If checkbox 1 is selected and then checkbox 2 can I clear the first one, allowing only one selection.

I know I can do this with option buttons, but would like to keep the same look.

Les

FSt1

Allow selection of only 1 checkbox
 
hi
in the check box code you have to add code to uncheck the other checkboxes
if the current check box is checked.
in checkbox1 code....
if checkbox1 = true then
checkbox2 = false
checkbox3 = false
end if
in checkbox2 code....
if checkbox2 = true then
checkbox1 = false
checkbox3 = false
end if
in checkbox3 code....
if checkbox3 = true then
checkbox1 = false
checkbox2 = false
end if

you have to do this for each check box, uncheck the other appropriate
checkboxes.

hope this helped
FSt1


"Les Linton" wrote:


I am modifying a paper document to be used electronically and trying not
to change the "look" of the document.

There are a number of sets of checkboxes (1 to 4)where only one is to
be selected.

If checkbox 1 is selected and then checkbox 2 can I clear the first
one, allowing only one selection.

I know I can do this with option buttons, but would like to keep the
same look.

Les




--
Les Linton


Peo Sjoblom

Allow selection of only 1 checkbox
 
Use the option buttons instead of check boxes, they have this built in

--

Regards,

Peo Sjoblom




"Les Linton" wrote in message
...

I am modifying a paper document to be used electronically and trying not
to change the "look" of the document.

There are a number of sets of checkboxes (1 to 4)where only one is to
be selected.

If checkbox 1 is selected and then checkbox 2 can I clear the first
one, allowing only one selection.

I know I can do this with option buttons, but would like to keep the
same look.

Les




--
Les Linton




Les Linton

Peo, you are correct in that would be the simplest solution, but the guy paying the bills wants checkboxes... You can't fight city hall.

Thanks to both you and FSt1 for your solutions.

This is a great forum!!

Les

Quote:

Originally Posted by Peo Sjoblom (Post 568699)
Use the option buttons instead of check boxes, they have this built in

--

Regards,

Peo Sjoblom




"Les Linton" wrote in message
...

I am modifying a paper document to be used electronically and trying not
to change the "look" of the document.

There are a number of sets of checkboxes (1 to 4)where only one is to
be selected.

If checkbox 1 is selected and then checkbox 2 can I clear the first
one, allowing only one selection.

I know I can do this with option buttons, but would like to keep the
same look.

Les




--
Les Linton



All times are GMT +1. The time now is 02:37 PM.

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