【发布时间】:2020-04-20 15:29:34
【问题描述】:
更改单元格 B12 的值(下拉菜单)时,单元格 B13 应提及“请选择...”,并且应清除范围 A16:N20 中的所有单元格,但不是公式(每个单元格范围内包含链接到单元格 B12、B13 和其他...的索引/匹配公式。这是当前不起作用的代码...
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$B$12" Then
With Application
.DisplayStatusBar = False
.ScreenUpdating = False
.EnableEvents = False
.Calculation = xlCalculationManual
End With
Range("B13").Value = "Please Select..."
Range("A16:N20").SpecialCells(xlCellTypeConstants, 23).ClearContents
With Application
.Calculation = xlCalculationAutomatic
.EnableEvents = True
.ScreenUpdating = True
.DisplayStatusBar = True
End With
End If
End Sub
此外,Excel 必须更新所有这些索引/匹配公式非常慢 - vba 中有没有办法让它更快?
【问题讨论】: