mardi 22 octobre 2019

Select All CheckBoxes from single CheckBox in VBA on PowerPoint

I am using PowerPoint to create UI mockups and have enabled the developer tools that create premade checkboxes, etc. I want to have a single checkbox that when selected, selects all the others on the slide.

I have tried the following code, which is accepted syntactically, but does nothing visibly.

this is a modified version from https://www.extendoffice.com/documents/excel/2692-excel-checkbox-select-all.html

CheckBox11 is my "Select All" check box and CheckBox 1-10 need to be selected or deselected based on it being clicked.

Sub SelectAll_Click()
    Dim xCheckBox As CheckBox
    For Each xCheckBox In Application.ActiveWindow.View.Slide.Checkboxes
        If xCheckBox.Name <> Application.ActiveWindow.View.Slide.Checkboxes("Check Box 11").Name Then
            xCheckBox.Value = Application.ActiveWindow.View.Slide.Checkboxes("Check Box 11").Value
        End If
    Next
End Sub

Private Sub CheckBox11_()
     SelectAll_Click
End Sub

How can I get this checkbox to check or uncheck the rest on the slide?




Aucun commentaire:

Enregistrer un commentaire