Autofilter Sucks!

Err

Active Member
Joined
Nov 16, 2006
Messages
274
Originally I posted a topic on this board which was moved here:
http://www.mrexcel.com/board2/viewtopic.php?t=248065

It was moved (I think) because the moderator thought I was asking a very obvious question (which I frequently do) -which is how to get autofilter to work.

In that thread, I think the answerers were being very defensive about Microsofts workaround which is basically -"don't use autofilter on numeric data". Furthermore, within the context of "asking for help"; people are going to give you the easiest way that they know how and not really discuss the issue -which is what I really wanted when I posted that thread here.

I'm not trying to be antagonistic here. But realistically -when you are running VBA -it is kinda ugly to add a leading Letter (I like "A") to every field before you autofilter it; then trim it off after the filter. It's ugly code because it's adding a 2 extra loops. If you have this (or several) autofilters inside nested loops then you are really slowing things down.

So here is a question -since I rarely ever have used Advanced Filter; does it have the same bug? Can you filter on numeric data specifying the begining characters? Can you specify a date range?

-Err
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
When filtering in code I prefer to use Advanced Filter. It doesn't have the same limitations that Autofilter does.
If you want to filter a number range, the trick is to set up the criteria section with 2 columns for the number. One will have >= the low value, the other will have <= the high value.
I park the Advanced Filter criteria away from the other data (you can hide the columns if you like).
Also, with dates: low value, high value as above. I *always* convert a date to its numeric value (using CDbl) for filtering. Keeps me sane.

Denis
 
Upvote 0

Forum statistics

Threads
1,225,269
Messages
6,183,960
Members
453,198
Latest member
VB6 Programming

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