velohead
Board Regular
- Joined
- Aug 22, 2007
- Messages
- 222
- Office Version
- 365
Hi All,
I have a table that is always Table1, but is always a different size, i.e. number of rows long and/or number of columns wide.
I always wish to filter the table to exclude zero value items (in a certain column) (always the same column).
When I record a macro, the macro seems to find what is not zero, and put that array into the macro.
example of recorded line -> ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=3, Criteria1:=Array("10", "100", "21", "4", "5"), Operator:=xlFilterValues
In my test spread sheet this is only a few items, however in my live macro it may be tens or hundreds, not just a few.
So, how do I get a macro that will filter non-zero items.
Thx.
Excel 365.
Data for table 1.....(you can copy/paste this, then make a table)...
I have a table that is always Table1, but is always a different size, i.e. number of rows long and/or number of columns wide.
I always wish to filter the table to exclude zero value items (in a certain column) (always the same column).
When I record a macro, the macro seems to find what is not zero, and put that array into the macro.
example of recorded line -> ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=3, Criteria1:=Array("10", "100", "21", "4", "5"), Operator:=xlFilterValues
In my test spread sheet this is only a few items, however in my live macro it may be tens or hundreds, not just a few.
So, how do I get a macro that will filter non-zero items.
Thx.
Excel 365.
Data for table 1.....(you can copy/paste this, then make a table)...
Ref | Beverage | Sales |
1 | Coke | 10 |
2 | Fanta | 100 |
3 | Pepsi | 21 |
4 | Dr Pepper | 0 |
5 | Seven Up | 5 |
6 | Tango | 4 |