vendredi 24 juillet 2015

Excel - checkbox select all in Visual Basic

I'm new to Visual Basic. I tried to

Sub SelectAll_Click()
'Update 20150309
Dim xCheckBox As CheckBox
For Each xCheckBox In Application.ActiveSheet.CheckBoxes
    If xCheckBox.Name <> Application.ActiveSheet.CheckBoxes("Check Box 1").Name Then
        xCheckBox.Value = Application.ActiveSheet.CheckBoxes("Check Box 1").Value
    End If
Next
End Sub

I have named my master checkbox as "Select All". I have trouble in Module Window where pops out Error 1004. If anybody know what am I doing wrong?




Aucun commentaire:

Enregistrer un commentaire