VBA:全选 全不选复选框
Sub qx() For Each chk In ActiveSheet.CheckBoxes If chk.Caption = "1.7" Then '选中了 chk.Value = 1 End If If chk.Caption = "1.6" Then '选中了 chk.Value = 1 End If If chk.Caption = "1.5" Then '选中了 chk.Value = 1 End If If chk.Caption = "1.4" Then '选中了 chk.Value = 1 End If If chk.Caption = "1.3" Then '选中了 chk.Value = 1 End If If chk.Caption = "1.2" Then '选中了 chk.Value = 1 End If If chk.Caption = "1.1" Then '选中了 chk.Value = 1 End If If chk.Caption = "1.0" Then '选中了 chk.Value = 1 End If Next Call chushi2 End Sub Sub qbx() For Each chk In ActiveSheet.CheckBoxes If chk.Caption = "1.7" Then '选中了 chk.Value = 0 End If If chk.Caption = "1.6" Then '选中了 chk.Value = 0 End If If chk.Caption = "1.5" Then '选中了 chk.Value = 0 End If If chk.Caption = "1.4" Then '选中了 chk.Value = 0 End If If chk.Caption = "1.3" Then '选中了 chk.Value = 0 End If If chk.Caption = "1.2" Then '选中了 chk.Value = 0 End If If chk.Caption = "1.1" Then '选中了 chk.Value = 0 End If If chk.Caption = "1.0" Then '选中了 chk.Value = 0 End If Next Call chushi2 End Sub