Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Adelisa Fischer   on Dec 24 In MS Office Category.

  
Question Answered By: Kian Evans   on Dec 24

for multi filtering u may use this code  examples...

Sheets("d").Select
Selection.AutoFilter Field:=1, Criteria1:="1"
Sheets("d").ShowAllData
Sheets("d").Select

If ComboBox2.Value <> "" Then
Selection.AutoFilter Field:=3, Criteria1:="=" & a4
Else
Sheets("n").Range("a1").Value = 1
End If

If ComboBox3.Value <> "" Then
Selection.AutoFilter Field:=4, Criteria1:="=" & a3
Else
Sheets("n").Range("a1").Value = 1
End If

If ComboBox1.Value <> "" Then
Selection.AutoFilter Field:=5, Criteria1:="=" & a2
Else
Sheets("n").Range("a1").Value = 1
End If

If DTPicker1.Value = "" Then
Sheets("n").Range("b2").Value = InputBox("Please input  date
(aa/gg/yyyy)")
Else
Sheets("n").Range("b2").Value = DTPicker1.Value
Selection.AutoFilter Field:=15, Criteria1:=">=" & a1,
operator:=xlAnd, Criteria2:="<=" & b1
End If


This code for a productivity manegement desicion support system...
it may became a specific example but u may use that format what ever
u want ( first paragraph for refreshing all input filtering history
, and other for multi criteria, and last of them is for filtering
date interval)

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Filter using VBA Or get search suggestion and latest updates.


Tagged: