Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default 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
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
filter multiple values Sunir M S New Users to Excel 8 November 26th 09 08:07 AM
Using Multiple Criteria to filter for multiple users fgwiii[_2_] Excel Worksheet Functions 5 June 11th 09 05:09 PM
Multiple filter on the same sheet genius Excel Discussion (Misc queries) 1 April 8th 09 02:35 PM
Filter Multiple Columns on Multiple Criteria and count the last co LBitler Excel Worksheet Functions 2 February 12th 09 08:36 PM
Macro: Filter Multiple header then extract to Multiple Files [email protected] Excel Discussion (Misc queries) 9 December 8th 06 10:44 PM


All times are GMT +1. The time now is 01:46 AM.

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

About Us

"It's about Microsoft Excel"