Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Multiple Filter in VBA
I have an excel sheet with 7 columns of data and I would
like to write VBA to filter the 3rd and 4th columns for the value "0.00". If a record has zero in both the 3rd and 4th columns I want it displayed. Otherwise, I want it to be filtered out. I used the record funcation and received this output: Selection.AutoFilter Field:=3, Criteria1:="=0.00", Operator:=xlAnd Selection.AutoFilter Field:=4, Criteria1:="=0.00", Operator:=xlAnd Please help. Thank you, Kevin |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Multiple Filter in VBA
Kevin
You don't actually say what you want help with. What doesn't happen that should ? What does happen that shouldn't ? When I recorded the macro I got this code: Selection.AutoFilter Selection.AutoFilter Field:=3, Criteria1:="0" Selection.AutoFilter Field:=4, Criteria1:="0" This can be tidied up a little: With Selection .AutoFilter .AutoFilter Field:=3, Criteria1:="0" .AutoFilter Field:=4, Criteria1:="0" End With Bear in mind that numeric 0.00 will be stored as 0. Are you looking for text "0.00" ? Regards Trevor "Kevin McLean" wrote in message ... I have an excel sheet with 7 columns of data and I would like to write VBA to filter the 3rd and 4th columns for the value "0.00". If a record has zero in both the 3rd and 4th columns I want it displayed. Otherwise, I want it to be filtered out. I used the record funcation and received this output: Selection.AutoFilter Field:=3, Criteria1:="=0.00", Operator:=xlAnd Selection.AutoFilter Field:=4, Criteria1:="=0.00", Operator:=xlAnd Please help. Thank you, Kevin |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
filter multiple values | New Users to Excel | |||
Using Multiple Criteria to filter for multiple users | Excel Worksheet Functions | |||
Multiple filter on the same sheet | Excel Discussion (Misc queries) | |||
Filter Multiple Columns on Multiple Criteria and count the last co | Excel Worksheet Functions | |||
Macro: Filter Multiple header then extract to Multiple Files | Excel Discussion (Misc queries) |