ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Filter on more than one field (https://www.excelbanter.com/excel-programming/407893-filter-more-than-one-field.html)

[email protected]

Filter on more than one field
 
Hi All,

Who can tell me the command of auto filter on more than one field? I
read Ron's example (http://www.rondebruin.nl/copy5.htm#sheet) Create a
new sheet for one unique value(AutoFilter) and found that Tip's on
Filter on more than one field, but I still don't understand. Because
his example already knew the Criteria, how about if don't know the
criteria? Only want to setup 2 field and copy all unique record? I
can do it only one filter (rng.AutoFilter Field:=FieldNum,
Criteria1:="=" & cell.Value), what's code for two filter?

Ron's example:
rng.AutoFilter Field:=1, Criteria1:="=Netherlands"
rng.AutoFilter Field:=3, Criteria1:="=F"

And how can I change the command, if the header is not on the first
row (e.g. the third row) and need to copy unique record include the
first row and next to the table empty row information to new
workbook. Below is my example, I need to split by dep't with
different approval to other workbook. My data on dept over 100's depts
and each of dept have more than 2 different approval. So, I need to
split many many file, pls help me.

Below is orignal file:

Account No: 12345678
Inv date: 19/03/08
Dep't Approval header3 header4
AC James
AC James
HR James
HR Kwok
HR Kwok

information xxx xxxxx

Output file should be look like as below:

Account No: 12345678
Inv date: 19/03/08
Dep't Approval header3 header4
HR Kwok
HR Kwok

Another output file as below:

Account No: 12345678
Inv date: 19/03/08
Dep't Approval header3 header4
HR James





[email protected]

Filter on more than one field
 
On 3$B7n(B18$BF|(B, $B2<8a(B11$B;~(B59$BJ,(B, wrote:
Hi All,

Who can tell me the command of auto filter on more than one field? I
read Ron's example (http://www.rondebruin.nl/copy5.htm#sheet) Create a
new sheet for one unique value(AutoFilter) and found that Tip's on
Filter on more than one field, but I still don't understand. Because
his example already knew the Criteria, how about if don't know the
criteria? Only want to setup 2 field and copy all unique record? I
can do it only one filter (rng.AutoFilter Field:=FieldNum,
Criteria1:="=" & cell.Value), what's code for two filter?

Ron's example:
rng.AutoFilter Field:=1, Criteria1:="=Netherlands"
rng.AutoFilter Field:=3, Criteria1:="=F"

And how can I change the command, if the header is not on the first
row (e.g. the third row) and need to copy unique record include the
first row and next to the table empty row information to new
workbook. Below is my example, I need to split by dep't with
different approval to other workbook. My data on dept over 100's depts
and each of dept have more than 2 different approval. So, I need to
split many many file, pls help me.

Below is orignal file:

Account No: 12345678
Inv date: 19/03/08
Dep't Approval header3 header4
AC James
AC James
HR James
HR Kwok
HR Kwok

information xxx xxxxx

Output file should be look like as below:

Account No: 12345678
Inv date: 19/03/08
Dep't Approval header3 header4
HR Kwok
HR Kwok


information xxx xxxxx

Another output file as below:

Account No: 12345678
Inv date: 19/03/08
Dep't Approval header3 header4
HR James


information xxx xxxxx



[email protected]

Filter on more than one field
 
On 3$B7n(B19$BF|(B, $Be8a(B12$B;~(B04$BJ,(B, wrote:
On 3$B7n(B18$BF|(B, $B2<8a(B11$B;~(B59$BJ,(B, wrote:



Hi All,


Who can tell me the command of auto filter on more than one field? I
read Ron's example (http://www.rondebruin.nl/copy5.htm#sheet) Create a
new sheet for one unique value(AutoFilter) and found that Tip's on
Filter on more than one field, but I still don't understand. Because
his example already knew the Criteria, how about if don't know the
criteria? Only want to setup 2 field and copy all unique record? I
can do it only one filter (rng.AutoFilter Field:=FieldNum,
Criteria1:="=" & cell.Value), what's code for two filter?


Ron's example:
rng.AutoFilter Field:=1, Criteria1:="=Netherlands"
rng.AutoFilter Field:=3, Criteria1:="=F"


And how can I change the command, if the header is not on the first
row (e.g. the third row) and need to copy unique record include the
first row and next to the table empty row information to new
workbook. Below is my example, I need to split by dep't with
different approval to other workbook. My data on dept over 100's depts
and each of dept have more than 2 different approval. So, I need to
split many many file, pls help me.


Below is orignal file:


Account No: 12345678
Inv date: 19/03/08
Dep't Approval header3 header4
AC James
AC James
HR James
HR Kwok
HR Kwok


information xxx xxxxx


Output file should be look like as below:


Account No: 12345678
Inv date: 19/03/08
Dep't Approval header3 header4
HR Kwok
HR Kwok
information xxx xxxxx


Another output file as below:


Account No: 12345678
Inv date: 19/03/08
Dep't Approval header3 header4
HR James
information xxx xxxxx- $Bp,i6Ho0zMQJ8;z(B -


- $Bp}<(Ho0zMQJ8;z(B -


sorry, output file should be one empty row above on "information xxx
xxxx"

[email protected]

Filter on more than one field
 
Any one can help me?


All times are GMT +1. The time now is 11:17 PM.

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