Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
mulitple checkboxes - changing value of all of them at once
Hello,
I have mulitple checkbox controls (selected from the "control" toolbar) on one worksheet. I would like to set the state of each checkbox to unchecked all at once. I have figured out how to select all the checkboxes at one time using: ActiveSheet.OLEObjects.Select But I cannot figure out how to change the value of all of them to "false". I have tried, with no luck: Selection.Value = false Selection.oleobjects.Value = false Selection.oleobjects.object.Value = false etc etc Anyone how to do this? Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
mulitple checkboxes - changing value of all of them at once
I think you have to loop through them set them to false one at a time:
Sub UnCheck() Dim ob As OLEObject For Each ob In ActiveSheet.OLEObjects If TypeName(ob.Object) = "CheckBox" Then ob.Object.Value = False End If Next ob End Sub Hope this helps Rowan "nathan" wrote: Hello, I have mulitple checkbox controls (selected from the "control" toolbar) on one worksheet. I would like to set the state of each checkbox to unchecked all at once. I have figured out how to select all the checkboxes at one time using: ActiveSheet.OLEObjects.Select But I cannot figure out how to change the value of all of them to "false". I have tried, with no luck: Selection.Value = false Selection.oleobjects.Value = false Selection.oleobjects.object.Value = false etc etc Anyone how to do this? Thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
mulitple checkboxes - changing value of all of them at once
Worked for me...
Requires a project reference to Microsoft Forms 2.0 object library. '----------------------- Sub TurnThemOff() Dim objCB As OLEObject For Each objCB In ActiveSheet.OLEObjects If TypeOf objCB.Object Is MSForms.CheckBox Then objCB.Object.Value = False End If Next Set objCB = Nothing End Sub '--------------------------- Jim Cone San Francisco, USA "nathan" wrote in message ... Hello, I have mulitple checkbox controls (selected from the "control" toolbar) on one worksheet. I would like to set the state of each checkbox to unchecked all at once. I have figured out how to select all the checkboxes at one time using: ActiveSheet.OLEObjects.Select But I cannot figure out how to change the value of all of them to "false". I have tried, with no luck: Selection.Value = false Selection.oleobjects.Value = false Selection.oleobjects.object.Value = false etc etc Anyone how to do this? Thanks. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
mulitple checkboxes - changing value of all of them at once
That works, thanks to both of you.
"Jim Cone" wrote: Worked for me... Requires a project reference to Microsoft Forms 2.0 object library. '----------------------- Sub TurnThemOff() Dim objCB As OLEObject For Each objCB In ActiveSheet.OLEObjects If TypeOf objCB.Object Is MSForms.CheckBox Then objCB.Object.Value = False End If Next Set objCB = Nothing End Sub '--------------------------- Jim Cone San Francisco, USA "nathan" wrote in message ... Hello, I have mulitple checkbox controls (selected from the "control" toolbar) on one worksheet. I would like to set the state of each checkbox to unchecked all at once. I have figured out how to select all the checkboxes at one time using: ActiveSheet.OLEObjects.Select But I cannot figure out how to change the value of all of them to "false". I have tried, with no luck: Selection.Value = false Selection.oleobjects.Value = false Selection.oleobjects.object.Value = false etc etc Anyone how to do this? Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Mulitple value lookup | Excel Worksheet Functions | |||
Changing mulitple tab names | Excel Worksheet Functions | |||
Mulitple formulas | Excel Discussion (Misc queries) | |||
mulitple criteria | Excel Discussion (Misc queries) | |||
Changes to Mulitple Worksheets | Excel Worksheet Functions |