messinho
05-29-2008, 11:33 AM
Hello!
I'm looking for a way to loop through the ActiveX controls (option buttons, checkboxes,...) in one presentation.
If I have 100 checkboxes (not on a user form), but on presentation, and I want to create a button that says "Clear All" (meaning 'clear all checkboxes'), I need to write a very tedious code like that:
Private Sub CommandButton1_Click()
CheckBox1.Value = False
CheckBox2.Value = False
...
CheckBox100.Value = False
End Sub
There?s any simpler way to do this in a loop? Something like that :
For i=1 To 100
Checkbox............ .Value=False
Next i
Remember that I created the checkboxes from Control Toolbar, NOT on the user form.
I have tried the following codes but i don?t know how modify them to Powerpoint. (Excel codes from the net...)
Private Sub CommandButton1_Click()
Dim objX As Object
With ActiveSheet
For Each objX In .OLEObjects
If TypeName(objX.Object) = "CheckBox" Then
objX.Object.Value = False
End If
Next
End With
End Sub
With ActiveSheet
For i = 1 To 3
.Shapes("Checkbox" & i).OLEFormat.Object.Object.Value = False
Next
Thanks,
messinho
I'm looking for a way to loop through the ActiveX controls (option buttons, checkboxes,...) in one presentation.
If I have 100 checkboxes (not on a user form), but on presentation, and I want to create a button that says "Clear All" (meaning 'clear all checkboxes'), I need to write a very tedious code like that:
Private Sub CommandButton1_Click()
CheckBox1.Value = False
CheckBox2.Value = False
...
CheckBox100.Value = False
End Sub
There?s any simpler way to do this in a loop? Something like that :
For i=1 To 100
Checkbox............ .Value=False
Next i
Remember that I created the checkboxes from Control Toolbar, NOT on the user form.
I have tried the following codes but i don?t know how modify them to Powerpoint. (Excel codes from the net...)
Private Sub CommandButton1_Click()
Dim objX As Object
With ActiveSheet
For Each objX In .OLEObjects
If TypeName(objX.Object) = "CheckBox" Then
objX.Object.Value = False
End If
Next
End With
End Sub
With ActiveSheet
For i = 1 To 3
.Shapes("Checkbox" & i).OLEFormat.Object.Object.Value = False
Next
Thanks,
messinho