excel - 宏中的复选框弹出窗口
问题描述
宏应该向用户选择显示 2 个选项,并且根据该选择,必须执行某些代码
例如在公告中
- 百分比1 = 5%
- 百分比2 = 2%
用户将根据输入宏应相应运行来选择 Option1 或 Option2。
以上条件是我整个宏的一小部分
下面是必须在选择框中的代码
CallCount1 = Cells(Rows.Count, "A").End(xlUp).Row
Selection.AutoFilter field:=16, Criteria1:="ABANDON"
AbCount1 = Worksheets("Sheet1").AutoFilter.Range.Columns(1).SpecialCells(xlCellTypeVisible).Cells.Count - 1
Percentage1 = (AbCount1 / CallCount1) * 100
MsgBox Percentage1
Selection.AutoFilter field:=14, Criteria1:=">=60"
AbCount2 = Worksheets("Sheet1").AutoFilter.Range.Columns(1).SpecialCells(xlCellTypeVisible).Cells.Count - 1
AbCount = AbCount1 - AbCount2
CallCount2 = CallCount1 - AbCount2
Percentage2 = (AbCount2 / CallCount2) * 100
MsgBox Percentage2
解决方案
推荐阅读
- python - IntegrityError IntegrityError 在 /api/movies/2/rate_movie
- c# - WPF - WrapPanel 子项高度
- html - 从顶部设置子菜单位置
- asp.net-core - 如何覆盖 ef 核心以自动写入数据或记录到文件?
- javascript - 如何从 React Native 中的异步 JS 函数返回变量的值
- java - 带有 Spring Boot 未授权 (401) 响应的 OAuth2
- javascript - 两个不同 Web 客户端之间的 Web RTC 不工作
- c++ - 读取文本文件的不同方法?
- r - 加入没有标题的 CSV,而不会丢失 R 中的任何列/行
- laravel - Laravel 6-邮件未从本地主机发送