ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Filter/Advanced Filter (https://www.excelbanter.com/excel-programming/315983-filter-advanced-filter.html)

soniya

Filter/Advanced Filter
 
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



Ron de Bruin

Filter/Advanced Filter
 
Hi Soniya

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

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Soniya" wrote in message ...
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





No Name

Filter/Advanced Filter
 
Hi Ron,

Different Columns

Thanks

-----Original Message-----
Hi Soniya

Do you want to filter the six Criteria in the same

column

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Soniya" wrote in

message ...
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




.


Ron de Bruin

Filter/Advanced Filter
 
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 Dataadvanced filter

If you want a code example post back


--
Regards Ron de Bruin
http://www.rondebruin.nl


wrote in message ...
Hi Ron,

Different Columns

Thanks

-----Original Message-----
Hi Soniya

Do you want to filter the six Criteria in the same

column

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Soniya" wrote in

message ...
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




.




Ron de Bruin

Filter/Advanced Filter
 
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


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Ron de Bruin" wrote in message ...
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 Dataadvanced filter

If you want a code example post back


--
Regards Ron de Bruin
http://www.rondebruin.nl


wrote in message ...
Hi Ron,

Different Columns

Thanks

-----Original Message-----
Hi Soniya

Do you want to filter the six Criteria in the same

column

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Soniya" wrote in

message ...
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




.







All times are GMT +1. The time now is 05:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com