ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   checkboxes (https://www.excelbanter.com/excel-programming/397013-checkboxes.html)

hshayhorn

checkboxes
 
I'm looking for a way to uncheck check boxes all at once rather than one line
at a time. If I use ActiveSheet.CheckBoxes("Check Box 1").Value = 0 I'm fine
but I have about 30 check boxes I would like to do this to.

ActiveSheet.CheckBoxes.Visible = False 'this works great. It hides them all


ActiveSheet.CheckBoxes.Value = 0 'this doesn't work at all. I get
an error. Is there an easy way to make all check boxes blank? I have the
default value set to unchecked but I need to reset them sort a speak based on
other things going on.


joel

checkboxes
 
I think this works

for each mybox in ActiveSheet.CheckBoxes
mybox.value = 0
next mybox

"hshayhorn" wrote:

I'm looking for a way to uncheck check boxes all at once rather than one line
at a time. If I use ActiveSheet.CheckBoxes("Check Box 1").Value = 0 I'm fine
but I have about 30 check boxes I would like to do this to.

ActiveSheet.CheckBoxes.Visible = False 'this works great. It hides them all


ActiveSheet.CheckBoxes.Value = 0 'this doesn't work at all. I get
an error. Is there an easy way to make all check boxes blank? I have the
default value set to unchecked but I need to reset them sort a speak based on
other things going on.


Dave Peterson

checkboxes
 
Maybe...

ActiveSheet.CheckBoxes.Value = xlOff 'or xlOn




hshayhorn wrote:

I'm looking for a way to uncheck check boxes all at once rather than one line
at a time. If I use ActiveSheet.CheckBoxes("Check Box 1").Value = 0 I'm fine
but I have about 30 check boxes I would like to do this to.

ActiveSheet.CheckBoxes.Visible = False 'this works great. It hides them all

ActiveSheet.CheckBoxes.Value = 0 'this doesn't work at all. I get
an error. Is there an easy way to make all check boxes blank? I have the
default value set to unchecked but I need to reset them sort a speak based on
other things going on.


--

Dave Peterson

Dave Peterson

checkboxes
 
But your code did work ok for me.




hshayhorn wrote:

I'm looking for a way to uncheck check boxes all at once rather than one line
at a time. If I use ActiveSheet.CheckBoxes("Check Box 1").Value = 0 I'm fine
but I have about 30 check boxes I would like to do this to.

ActiveSheet.CheckBoxes.Visible = False 'this works great. It hides them all

ActiveSheet.CheckBoxes.Value = 0 'this doesn't work at all. I get
an error. Is there an easy way to make all check boxes blank? I have the
default value set to unchecked but I need to reset them sort a speak based on
other things going on.


--

Dave Peterson


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

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