View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Nathan Nathan is offline
external usenet poster
 
Posts: 64
Default 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.