VBA:全選 全不選複選框
阿新 • • 發佈:2021-08-08
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 IfIf 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 EndIf 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