首页 > 解决方案 > 宏中的复选框弹出窗口

问题描述

宏应该向用户选择显示 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

标签: excelvba

解决方案


推荐阅读