Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default Check All Check Boxes

Sorry, about this, but my head is sore from pounding on the desk....

Have a handful of check marks that I put on via the Forms Check Box and
want to have a sub that will check/uncheck all of them. However, i
can't even get the basics on this. What am i missing? I keep getting
error messages no matter how I try to tweak...last error is "object
required"

Sub CheckAll_Houses()
With ActiveSheet
CheckBox18.Value = True
CheckBox19.Value = True
CheckBox20.Value = True
CheckBox21.Value = True
CheckBox22.Value = True
End With
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Check All Check Boxes

You can do this for all Forms checkboxes

ActiveSheet.CheckBoxes.Value = True


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Native" wrote in message ups.com...
Sorry, about this, but my head is sore from pounding on the desk....

Have a handful of check marks that I put on via the Forms Check Box and
want to have a sub that will check/uncheck all of them. However, i
can't even get the basics on this. What am i missing? I keep getting
error messages no matter how I try to tweak...last error is "object
required"

Sub CheckAll_Houses()
With ActiveSheet
CheckBox18.Value = True
CheckBox19.Value = True
CheckBox20.Value = True
CheckBox21.Value = True
CheckBox22.Value = True
End With
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Check All Check Boxes

Are you sure they're from the Forms toolbar?

Those checkboxes usually have names like "Check Box 1"

But if they are from the Forms toolbar:

activesheet.checkboxes.value = xlon 'xloff



Native wrote:

Sorry, about this, but my head is sore from pounding on the desk....

Have a handful of check marks that I put on via the Forms Check Box and
want to have a sub that will check/uncheck all of them. However, i
can't even get the basics on this. What am i missing? I keep getting
error messages no matter how I try to tweak...last error is "object
required"

Sub CheckAll_Houses()
With ActiveSheet
CheckBox18.Value = True
CheckBox19.Value = True
CheckBox20.Value = True
CheckBox21.Value = True
CheckBox22.Value = True
End With
End Sub


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Check All Check Boxes

If they are from the Control Toolbox then use

For Each obj In ActiveSheet.OLEObjects
If TypeOf obj.Object Is MSForms.CheckBox Then
obj.Object.Value = True
End If
Next


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Ron de Bruin" wrote in message ...
You can do this for all Forms checkboxes

ActiveSheet.CheckBoxes.Value = True


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Native" wrote in message ups.com...
Sorry, about this, but my head is sore from pounding on the desk....

Have a handful of check marks that I put on via the Forms Check Box and
want to have a sub that will check/uncheck all of them. However, i
can't even get the basics on this. What am i missing? I keep getting
error messages no matter how I try to tweak...last error is "object
required"

Sub CheckAll_Houses()
With ActiveSheet
CheckBox18.Value = True
CheckBox19.Value = True
CheckBox20.Value = True
CheckBox21.Value = True
CheckBox22.Value = True
End With
End Sub





  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default Check All Check Boxes

Dave: You da man

Have the names wrong...they are "Check Box 18" etc

how do I make them on or off given this? I tried to space them, but no
work.

I would like to specify which are on/off because a few are still place
holders.



Dave Peterson wrote:
Are you sure they're from the Forms toolbar?

Those checkboxes usually have names like "Check Box 1"

But if they are from the Forms toolbar:

activesheet.checkboxes.value = xlon 'xloff



Native wrote:

Sorry, about this, but my head is sore from pounding on the desk....

Have a handful of check marks that I put on via the Forms Check Box and
want to have a sub that will check/uncheck all of them. However, i
can't even get the basics on this. What am i missing? I keep getting
error messages no matter how I try to tweak...last error is "object
required"

Sub CheckAll_Houses()
With ActiveSheet
CheckBox18.Value = True
CheckBox19.Value = True
CheckBox20.Value = True
CheckBox21.Value = True
CheckBox22.Value = True
End With
End Sub


--

Dave Peterson




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Check All Check Boxes

with activesheet
.checkboxes("check box 18").value = xlon
.checkboxes("Check box 32").value = xloff
'etc
end with

If you named the checkboxes nicely, you could use some kind of loop:

dim myCBX as checkbox

for each myCBX in activesheet.checkboxes
if lcase(mycbx.name) like "spec_*" then
'do nothing
else
mycbx.value = xloff 'xlon
end if
next mycbx

Give the special checkboxes a nice name--just select the checkbox and type the
new name in the name box (to the left of the formula bar) and don't forget to
hit enter.

Native wrote:

Dave: You da man

Have the names wrong...they are "Check Box 18" etc

how do I make them on or off given this? I tried to space them, but no
work.

I would like to specify which are on/off because a few are still place
holders.

Dave Peterson wrote:
Are you sure they're from the Forms toolbar?

Those checkboxes usually have names like "Check Box 1"

But if they are from the Forms toolbar:

activesheet.checkboxes.value = xlon 'xloff



Native wrote:

Sorry, about this, but my head is sore from pounding on the desk....

Have a handful of check marks that I put on via the Forms Check Box and
want to have a sub that will check/uncheck all of them. However, i
can't even get the basics on this. What am i missing? I keep getting
error messages no matter how I try to tweak...last error is "object
required"

Sub CheckAll_Houses()
With ActiveSheet
CheckBox18.Value = True
CheckBox19.Value = True
CheckBox20.Value = True
CheckBox21.Value = True
CheckBox22.Value = True
End With
End Sub


--

Dave Peterson


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linked Check Boxes blueegypt Excel Discussion (Misc queries) 4 May 12th 06 10:36 PM
Can one cell hold multiple check boxes (and then sort based off e. OT Excel Discussion (Misc queries) 1 March 29th 06 07:32 PM
why do check boxes move when printing excel spreadhseets Simon Jefford Excel Discussion (Misc queries) 3 June 22nd 05 02:04 PM
Selecting Check Boxes shezzer_1972 Excel Discussion (Misc queries) 7 May 11th 05 01:10 AM
How to align check boxes on an Excel sheet? CC Excel Worksheet Functions 2 February 16th 05 03:27 PM


All times are GMT +1. The time now is 07:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"