如何自动过滤具有空白背景颜色但有数据的单元格?
我需要传入 colorIndex 什么值才能得到以下结果?
Sub FilterByColor()
Dim rng As Range
Dim cell As Range
Dim colorIndex As Long
Set rng = Range("A1:A100")
colorIndex = -4142
'What is the value of null color?
rng.AutoFilter Field:=1, Criteria1:=colorIndex, Operator:=xlFilterCellColor
End Sub
调用 FilterBycolor()
当颜色索引 = -4142 时:
这不是我想要的输出。
我尝试过 colorIndex =-4142 、xlNone 、 xlColorIndexAutomatic 、 xlColorIndexNone 、 None 、 Null 、 vbWhite 。
他们都没有达到我的期望。 请帮助我。谢谢!
请尝试
Rng.AutoFilter Field:=1, Operator:=xlFilterNoFill