vba help - Autofilter between two number and <>0

Mallesh23

Well-known Member
Joined
Feb 4, 2009
Messages
976
Office Version
  1. 2010
Platform
  1. Windows
Hi Team,

I am Unable to apply autofilter <>0 on a single column.
Below is my attempted code, when tried applying <>0 , I loose previous autofilter. plz assist. Thanks.

VBA Code:
 Sub Apply_Filter()           
        With Range("$A$1:$A$20")
            .AutoFilter Field:=1, Criteria1:="<500", Operator:=xlAnd, Criteria2:=">-500"
            .AutoFilter Field:=1, Criteria1:="<>0"
        End With
                   
    End Sub


Below is my Column with data in it.

Book1
A
1Amount
2-121
3391
4-408
5891
6948
7-500
8386
9-427
1033
11942
12870
13-261
14979
15955
160
170
18400
19-600
Sheet1


Thanks
mg
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Hi Team,

After Autofilter , I should see Below visible cells,
can we get this through output.

Book2
ABC
1AmountExpected Visible cells after autofilter
2-121-121
3391391
4-408-408
5891386
6948-427
7-50033
8386-261
9-427400
1033
11942
12870
13-261
14979
15955
160
170
18400
19-600
Sheet1


Thanks
mg
 
Upvote 0
Hi

With more than 2 criteria you can use the Advanced Filter or an auxiliary column.
 
Upvote 0

Forum statistics

Threads
1,214,968
Messages
6,122,509
Members
449,089
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top