excel - 仅在满足条件时才选中所有复选框
问题描述
我有一个 VBA 代码可以选中/取消选中所有复选框。但是,我希望代码仅选中/取消选中 E5:E150 列中没有“False”的复选框。
任何帮助将不胜感激,这是我的代码:
Sub SelectAllSubSector()
Dim cBoxSector As CheckBox
For Each cBoxSector In Worksheets("Input attractivite").CheckBoxes
If Not Intersect(cBoxSector.TopLeftCell, Range("C5:C150")) Is Nothing Then
If cBoxSector.Name <> ActiveSheet.CheckBoxes("Check Box 3").Name Then
cBoxSector.Value = ActiveSheet.CheckBoxes("Check Box 3").Value
End If
End If
Next cBoxSector
End Sub
解决方案
推荐阅读
- c++ - 为什么 DeviceIoControl 有时不工作(错误=2)?
- python - 如何正确使用 ValueError 函数?
- amazon-web-services - Terraform AWS 无法 ping,或者 ssh 刚刚创建了 EC2 实例
- bash - 难以理解 AWK 语法
- ansible - 如果目标文件不存在,Ansible get_url 将失败
- python - 寻找查找代码以将列添加到从同一数据帧查询的 Pandas 数据帧
- android - Android Json Object放了一个没有key的Array JSON
- python - 尽管最近工作,Tkinter 屏幕仍显示为黑色
- python - 没有文件夹的熊猫读取路径
- python - 使用 gmail API 访问电子邮件正文中的链接