Autofilter weird behavior

  • Thread starter Thread starter Yarroll
  • Start date Start date
Y

Yarroll

Hi,

Is there something special about the way Autofilter works in macros?

Lets say there's a lot of values in column B and I want Excel to show (2
criteria) only values >2 or equal to "DIV/0!" A simple macro created for the
purpose would show 2s, but almost certainly would skip DIV/0. Whereas manual
check (also using Autofilter) shows alright these DIV/0s. I recall it caused
a lot of manual work for me once.

What gives? I can't even tell you the macro contents, as I concluded long
time ago it's better to forget Autofilter in macros completely. Like
something you take for so certain you dont even dare to ask :-))

Thanks. Best regrds. Yarroll
 
This appears to work if this helps

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 3/20/2004 by Frank Haverkamp
'

'
Rows("31:31").Select 'Row above Data
Selection.AutoFilter 'Turn On Autofilter
Selection.AutoFilter Field:=3, Criteria1:=">2", Operator:=xlOr, _
Criteria2:="=#DIV/0!" 'Set Criteria
End Su
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top