Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Create macro to filter on multiple criteria

I have 6 columns in my worksheet which are grouped into 3 pairs of columns.
Columns A, C and E are the current data for a given product and Columns B, D,
and F are the previous data. For instance, Column A result for cell 1 is
"January" and Column B result for cell 1 is "March". Similarly for the other
two sets of columns.

What I want to be able to do is filter to just those rows were the current
data is different from the previous data. Therefore, I need to filter on
Columns A, C, and E to just those rows where Column A is different than
Column B, or Column C is different than Column D, or Column E is different
than Column F.

I can do this individually for Columns A/B, or C/D, or E/F using advanced
filter but want to be able to 1) create a macro to do it, and 2) be able to
do it using all 3 sets of columns as the criteria.

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 132
Default Create macro to filter on multiple criteria

One approach is to have separate columns that represent where the conditions
are met. For example, you could have column H be True if A=C, I be True if
B=D, J be True if C=E, K true is H=I=J=True. Then you can filter on any of
these conditional columns.

Not sure of your macro-writing ability, but you could also implement the
same functionality in code.

Regards,
Bill


"csdjj021191" wrote:

I have 6 columns in my worksheet which are grouped into 3 pairs of columns.
Columns A, C and E are the current data for a given product and Columns B, D,
and F are the previous data. For instance, Column A result for cell 1 is
"January" and Column B result for cell 1 is "March". Similarly for the other
two sets of columns.

What I want to be able to do is filter to just those rows were the current
data is different from the previous data. Therefore, I need to filter on
Columns A, C, and E to just those rows where Column A is different than
Column B, or Column C is different than Column D, or Column E is different
than Column F.

I can do this individually for Columns A/B, or C/D, or E/F using advanced
filter but want to be able to 1) create a macro to do it, and 2) be able to
do it using all 3 sets of columns as the criteria.

Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Create macro to filter on multiple criteria



"Bill Pfister" wrote:

One approach is to have separate columns that represent where the conditions
are met. For example, you could have column H be True if A=C, I be True if
B=D, J be True if C=E, K true is H=I=J=True. Then you can filter on any of
these conditional columns.

Not sure of your macro-writing ability, but you could also implement the
same functionality in code.

Regards,
Bill


"csdjj021191" wrote:

I have 6 columns in my worksheet which are grouped into 3 pairs of columns.
Columns A, C and E are the current data for a given product and Columns B, D,
and F are the previous data. For instance, Column A result for cell 1 is
"January" and Column B result for cell 1 is "March". Similarly for the other
two sets of columns.

What I want to be able to do is filter to just those rows were the current
data is different from the previous data. Therefore, I need to filter on
Columns A, C, and E to just those rows where Column A is different than
Column B, or Column C is different than Column D, or Column E is different
than Column F.

I can do this individually for Columns A/B, or C/D, or E/F using advanced
filter but want to be able to 1) create a macro to do it, and 2) be able to
do it using all 3 sets of columns as the criteria.

Thanks!

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Create macro to filter on multiple criteria

Thanks, Bill. I'd like to be able to handle this without adding all of the
separate columns. Is there any way to do all of it via a basic macro without
having to create extra columns within the worksheet?

"Bill Pfister" wrote:

One approach is to have separate columns that represent where the conditions
are met. For example, you could have column H be True if A=C, I be True if
B=D, J be True if C=E, K true is H=I=J=True. Then you can filter on any of
these conditional columns.

Not sure of your macro-writing ability, but you could also implement the
same functionality in code.

Regards,
Bill


"csdjj021191" wrote:

I have 6 columns in my worksheet which are grouped into 3 pairs of columns.
Columns A, C and E are the current data for a given product and Columns B, D,
and F are the previous data. For instance, Column A result for cell 1 is
"January" and Column B result for cell 1 is "March". Similarly for the other
two sets of columns.

What I want to be able to do is filter to just those rows were the current
data is different from the previous data. Therefore, I need to filter on
Columns A, C, and E to just those rows where Column A is different than
Column B, or Column C is different than Column D, or Column E is different
than Column F.

I can do this individually for Columns A/B, or C/D, or E/F using advanced
filter but want to be able to 1) create a macro to do it, and 2) be able to
do it using all 3 sets of columns as the criteria.

Thanks!

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 132
Default Create macro to filter on multiple criteria

Yes, you can have the macro compare the values of the columns of interest and
then hide rows when they don't meet your filter criteria.


"csdjj021191" wrote:

Thanks, Bill. I'd like to be able to handle this without adding all of the
separate columns. Is there any way to do all of it via a basic macro without
having to create extra columns within the worksheet?

"Bill Pfister" wrote:

One approach is to have separate columns that represent where the conditions
are met. For example, you could have column H be True if A=C, I be True if
B=D, J be True if C=E, K true is H=I=J=True. Then you can filter on any of
these conditional columns.

Not sure of your macro-writing ability, but you could also implement the
same functionality in code.

Regards,
Bill


"csdjj021191" wrote:

I have 6 columns in my worksheet which are grouped into 3 pairs of columns.
Columns A, C and E are the current data for a given product and Columns B, D,
and F are the previous data. For instance, Column A result for cell 1 is
"January" and Column B result for cell 1 is "March". Similarly for the other
two sets of columns.

What I want to be able to do is filter to just those rows were the current
data is different from the previous data. Therefore, I need to filter on
Columns A, C, and E to just those rows where Column A is different than
Column B, or Column C is different than Column D, or Column E is different
than Column F.

I can do this individually for Columns A/B, or C/D, or E/F using advanced
filter but want to be able to 1) create a macro to do it, and 2) be able to
do it using all 3 sets of columns as the criteria.

Thanks!



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Create macro to filter on multiple criteria

Unfortunately, I don't know how to write the macro so that it uses more than
one criteria range when I want it to use 3 different criteria ranges. Any
ideas?

"Bill Pfister" wrote:

Yes, you can have the macro compare the values of the columns of interest and
then hide rows when they don't meet your filter criteria.


"csdjj021191" wrote:

Thanks, Bill. I'd like to be able to handle this without adding all of the
separate columns. Is there any way to do all of it via a basic macro without
having to create extra columns within the worksheet?

"Bill Pfister" wrote:

One approach is to have separate columns that represent where the conditions
are met. For example, you could have column H be True if A=C, I be True if
B=D, J be True if C=E, K true is H=I=J=True. Then you can filter on any of
these conditional columns.

Not sure of your macro-writing ability, but you could also implement the
same functionality in code.

Regards,
Bill


"csdjj021191" wrote:

I have 6 columns in my worksheet which are grouped into 3 pairs of columns.
Columns A, C and E are the current data for a given product and Columns B, D,
and F are the previous data. For instance, Column A result for cell 1 is
"January" and Column B result for cell 1 is "March". Similarly for the other
two sets of columns.

What I want to be able to do is filter to just those rows were the current
data is different from the previous data. Therefore, I need to filter on
Columns A, C, and E to just those rows where Column A is different than
Column B, or Column C is different than Column D, or Column E is different
than Column F.

I can do this individually for Columns A/B, or C/D, or E/F using advanced
filter but want to be able to 1) create a macro to do it, and 2) be able to
do it using all 3 sets of columns as the criteria.

Thanks!

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 132
Default Create macro to filter on multiple criteria

You won't be using the native Excel filtering capability; you will need to
write it from scratch. Here's an example:

http://wcpii.com/Documents/MacroFilter.xls


"csdjj021191" wrote:

Unfortunately, I don't know how to write the macro so that it uses more than
one criteria range when I want it to use 3 different criteria ranges. Any
ideas?

"Bill Pfister" wrote:

Yes, you can have the macro compare the values of the columns of interest and
then hide rows when they don't meet your filter criteria.


"csdjj021191" wrote:

Thanks, Bill. I'd like to be able to handle this without adding all of the
separate columns. Is there any way to do all of it via a basic macro without
having to create extra columns within the worksheet?

"Bill Pfister" wrote:

One approach is to have separate columns that represent where the conditions
are met. For example, you could have column H be True if A=C, I be True if
B=D, J be True if C=E, K true is H=I=J=True. Then you can filter on any of
these conditional columns.

Not sure of your macro-writing ability, but you could also implement the
same functionality in code.

Regards,
Bill


"csdjj021191" wrote:

I have 6 columns in my worksheet which are grouped into 3 pairs of columns.
Columns A, C and E are the current data for a given product and Columns B, D,
and F are the previous data. For instance, Column A result for cell 1 is
"January" and Column B result for cell 1 is "March". Similarly for the other
two sets of columns.

What I want to be able to do is filter to just those rows were the current
data is different from the previous data. Therefore, I need to filter on
Columns A, C, and E to just those rows where Column A is different than
Column B, or Column C is different than Column D, or Column E is different
than Column F.

I can do this individually for Columns A/B, or C/D, or E/F using advanced
filter but want to be able to 1) create a macro to do it, and 2) be able to
do it using all 3 sets of columns as the criteria.

Thanks!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
In Excel how can I filter multiple columns SIMULTANEOUSLY? Keleigh-G Excel Discussion (Misc queries) 5 May 25th 06 08:09 PM
Req: How to create multiple mutually exclusive filters six50joe Excel Worksheet Functions 2 September 26th 05 11:08 PM
How do i auto create multiple files from 1 with multiple sheets Kathy Excel Worksheet Functions 0 July 26th 05 01:23 AM
How do I record a macro which should work on multiple files ? Venkataraman.P.E Excel Discussion (Misc queries) 2 January 16th 05 10:26 AM
Why can't my macro use Auto Filter when I told the Sheet Protecti. KC Rippstein Excel Worksheet Functions 1 October 28th 04 06:13 PM


All times are GMT +1. The time now is 05:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"