Recorded Macro to filter out Zero values

smithgt

Board Regular
Joined
Jan 22, 2010
Messages
193
I've recored a Macro. I'm filtering a column and I want to hide values (rows) where the values = 0.

The recored macro has done the opposite, by only displaying values selected - see below. The problem will be when I run this on another sheet that doesn't have values matching this list.

ActiveSheet.Range("$A$1:$N$6837").AutoFilter Field:=14, Criteria1:=Array( _<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
"0.3", "0.4", "0.67", "1", "1.16", "10.5", "100", "1000", "10000", "1007.79", "109", "119" _<o:p></o:p>
, "119.15", "12000", "125", "1300", "13000", "144", "1500", "153", "157.62", "159.82", _<o:p></o:p>
"166.8", "169.02", "17.25", "176.25", "181.65", "193.36", "2.01", "20", "200", "2000", _<o:p></o:p>
"201", "211.39", "226", "226.54", "229.89", "232", "240", "243.22", "249.93", "25", "250" _<o:p></o:p>
, "2500", "25000", "258", "262.65", "2625", "270.43", "2750", "298.04", "298.73", "3.01", _<o:p></o:p>
"300", "3000", "314.8", "325", "3360", "342", "343.65", "35", "350", "3500", "360", "3600" _<o:p></o:p>
, "363", "368.06", "370", "374", "3750", "39.64", "40", "400", "4000", "40000", "42.73", _<o:p></o:p>
"4250", "450", "50", "500", "5000", "540", "5625", "57.61", "6", "600", "612.5", "62", "64" _<o:p></o:p>
, "700", "720", "73.53", "74", "74.3", "74.51", "75", "75.89", "750", "7500", "762.37", _<o:p></o:p>
"788", "800", "8000", "861.21", "87", "90", "9000", "932.86", "98"), Operator:= _<o:p></o:p>
xlFilterValues

How do I add a filter to hide zero values?

thanks
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,216,087
Messages
6,128,740
Members
449,466
Latest member
Peter Juhnke

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