体验零代码搭建

excel Criteria1实例

网友投稿  ·  2024-01-25 19:01  ·  云表格  ·  阅读 441


关于excel的Criteria1用法实例,是结合VBA来使用的,下面是关于Criteria1用法的几个例子,希望对你有所帮助。

关于excel的Criteria1用法实例,是结合VBA来使用的,下面是关于Criteria1用法的几个例子,希望对你有所帮助。

excel Criteria1实例

Sub SimpleOrFilter()

Worksheets("SalesReport").Select

Range("A1").AutoFilter

Range("A1").AutoFilter Field:=4,Criteria1:="=A", Operator:=xlOr, Criteria2:="=B"

End Sub

Sub SimpleAndFilter()

Worksheets("SalesReport").Select

Range("A1").AutoFilter

Range("A1").AutoFilter Field:=4, _

Criteria1:=">=A", _

Operator:=xlAnd, Criteria2:="<=EZZ"

End Sub

Sub Top10Filter()

Top 12 Revenue Records

Worksheets("SalesReport").Select

Range("A1").AutoFilter

Range("A1").AutoFilter Field:=6, Criteria1:="12",Operator:=xlTop10Items

End Sub

Sub MultiSelectFilter()

Worksheets("SalesReport").Select

Range("A1").AutoFilter

Range("A1").AutoFilter Field:=4, Criteria1:=Array("A", "C", "E","F", "H"),Operator:=xlFilterValues

End Sub

Sub DynamicAutoFilter()

Worksheets("SalesReport").Select

Range("A1").AutoFilter

Range("A1").AutoFilter Field:=3,Criteria1:=xlFilterNextYear,Operator:=xlFilterDynamic

End Sub

Sub FilterByIcon()

Worksheets("SalesReport").Select

Range("A1").AutoFilter

Range("A1").AutoFilter Field:=6, _

Criteria1:=ActiveWorkbook.IconSets(xl5ArrowsGray).Item(5),Operator:=xlFilterIcon

End Sub

Sub FilterByFillColor()

Worksheets("SalesReport").Select

Range("A1").AutoFilter

Range("A1").AutoFilter Field:=6, Criteria1:=RGB(255, 0, 0), Operator:=xlFilterCellColor

End Sub


Excel表格的10招必学秘技 << 上一篇
2024-01-25 19:01
excel正切值函数TAN
2024-01-25 19:01
下一篇 >>

相关推荐