Filter/Advanced Filter

  • Thread starter Thread starter Soniya
  • Start date Start date
S

Soniya

Hi All,

How many criteria I can Use in a Filter/Advanced Filter.

for Eg. If i want to use six Criteria A=Ab, B=xy, C=gh,
D=nd, E=cz F=bc how can I do this using Code?

TIa

Soniya
 
Hi Soniya

Do you want to filter the six Criteria in the same column
 
Hi

Do you want to do it manual or with code ?

Manual :
With your data in A5:F30 for example

Copy the header cells in A1:F1
Below each header enter your criteria

Use this criteria range then A1:F2 in Data>advanced filter

If you want a code example post back
 
With code try this

Enter the headers and criteria in this range first
Range("A1:F2")


Sub test()
Dim CriteriaRng As Range
Dim rng As Range
Set rng = Range("A5:F30") ' first row is the header row
Set CriteriaRng = Range("A1:F2")
rng.AdvancedFilter Action:=xlFilterInPlace, _
CriteriaRange:=CriteriaRng, Unique:=False
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top