瀏覽量:38次
關(guān)于excel的Criteria1用法實例,是結(jié)合VBA來使用的,下面是關(guān)于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
[聲明]本網(wǎng)轉(zhuǎn)載網(wǎng)絡(luò)媒體稿件是為了傳播更多的信息,此類稿件不代表本網(wǎng)觀點(diǎn),本網(wǎng)不承擔(dān)此類稿件侵權(quán)行為的連帶責(zé)任。故此,如果您發(fā)現(xiàn)本網(wǎng)站的內(nèi)容侵犯了您的版權(quán),請您的相關(guān)內(nèi)容發(fā)至此郵箱【779898168@qq.com】,我們在確認(rèn)后,會立即刪除,保證您的版權(quán)。
官網(wǎng)優(yōu)化
整站優(yōu)化
渠道代理
400-655-5776