Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Auto Filter - Multiple Conditions?
Excel2003 ... Protected WorkSheet ... I do not know Macro Code ... I record
Code then do some creative cut/paste. Issue ... I have a template with "Auto-Filter" Switches set on every Col. I use a recorded Macro to accomplish my task (2 Conditions) ... However, now I need to Filter on more than 2 Conditions ... My present Macro looks like: Sub A_Test_Filter() ' ' A_Test_Filter Macro ActiveSheet.Unprotect Selection.AutoFilter Field:=2, Criteria1:="=0182", Operator:=xlOr, _ Criteria2:="=2321" Range("C2").Select End Sub I have Macro Buttons & I need the Auto-Filter Switches so is there a way to accomplish this with Macro Code that will not disrupt the present workings of my Template? Thanks ... Kha |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Auto Filter - Multiple Conditions?
The custom autofilter can only handle 2 conditions. To identify data with
more than 2 conditions you need to resort to formula's. Some options are the INDEX and MATCH functions, or you can use the conditional sum wizard to summarise data based on multiple conditions. These functions will only summarise data, and not produce a filtered list. Alternatively if you really need a seperate list rather than summarised data you could develop some macros. Immediate thoughts are to have a data worksheet with a macro that sorts different fields based on a set criteria and copys this 'sorted' data over to a new worksheet. Can you provide a sample of data and more of a description of what you're trying to do? "Ken" wrote: Excel2003 ... Protected WorkSheet ... I do not know Macro Code ... I record Code then do some creative cut/paste. Issue ... I have a template with "Auto-Filter" Switches set on every Col. I use a recorded Macro to accomplish my task (2 Conditions) ... However, now I need to Filter on more than 2 Conditions ... My present Macro looks like: Sub A_Test_Filter() ' ' A_Test_Filter Macro ActiveSheet.Unprotect Selection.AutoFilter Field:=2, Criteria1:="=0182", Operator:=xlOr, _ Criteria2:="=2321" Range("C2").Select End Sub I have Macro Buttons & I need the Auto-Filter Switches so is there a way to accomplish this with Macro Code that will not disrupt the present workings of my Template? Thanks ... Kha |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Auto Filter - Multiple Conditions?
Ivor ... Unfortunately, I can not provide a sample ... Temp works find for my
Plant as I only needed 1 Filtered condition ... However, a sister Plant needed more than 2 conditions for Macro Button to work as I have it working. Solution was to disable this Button on sister Temp. Above said ... Thank you for your explanation & for supporting these boards .... Kha "Ivor Davies" wrote: The custom autofilter can only handle 2 conditions. To identify data with more than 2 conditions you need to resort to formula's. Some options are the INDEX and MATCH functions, or you can use the conditional sum wizard to summarise data based on multiple conditions. These functions will only summarise data, and not produce a filtered list. Alternatively if you really need a seperate list rather than summarised data you could develop some macros. Immediate thoughts are to have a data worksheet with a macro that sorts different fields based on a set criteria and copys this 'sorted' data over to a new worksheet. Can you provide a sample of data and more of a description of what you're trying to do? "Ken" wrote: Excel2003 ... Protected WorkSheet ... I do not know Macro Code ... I record Code then do some creative cut/paste. Issue ... I have a template with "Auto-Filter" Switches set on every Col. I use a recorded Macro to accomplish my task (2 Conditions) ... However, now I need to Filter on more than 2 Conditions ... My present Macro looks like: Sub A_Test_Filter() ' ' A_Test_Filter Macro ActiveSheet.Unprotect Selection.AutoFilter Field:=2, Criteria1:="=0182", Operator:=xlOr, _ Criteria2:="=2321" Range("C2").Select End Sub I have Macro Buttons & I need the Auto-Filter Switches so is there a way to accomplish this with Macro Code that will not disrupt the present workings of my Template? Thanks ... Kha |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Auto filter for multiple columns | Excel Discussion (Misc queries) | |||
Search multiple cells with conditions, sum and auto populate! | Excel Worksheet Functions | |||
Summary Counts Functions to filter multiple conditions | Excel Worksheet Functions | |||
How do I filter with multiple conditions in one field? | Excel Discussion (Misc queries) | |||
Auto Filter Multiple Selections | Excel Discussion (Misc queries) |