ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Scripting Autofilters.. (https://www.excelbanter.com/excel-programming/344190-scripting-autofilters.html)

Mark

Scripting Autofilters..
 
I've been working with scripting an autofilter.

It appears to me that to apply filters, etc, you need to do that from the
range object's autofilter property.

I had thought you would be able to dimension an object as an autofilter, set
that object to an autofilter, and then work through that.

Is that incorrect?



Tom Ogilvy

Scripting Autofilters..
 
No, you apply a filter to a range.

Dim aFilt as Autofilter
Range("A1").CurrentRegion.AutoFilter Field:=1, Criteria1:="C"
set aFilt = Activesheet.AutoFilter

However, the aFilt is an autofilter *object*. You can use it to examine
what the current settings of the items in the Filters collection are, but to
set those filters, you use the autofilter *method* of the range object.

--
Regards,
Tom Ogilvy


"mark" wrote in message
...
I've been working with scripting an autofilter.

It appears to me that to apply filters, etc, you need to do that from the
range object's autofilter property.

I had thought you would be able to dimension an object as an autofilter,

set
that object to an autofilter, and then work through that.

Is that incorrect?





Mark

Scripting Autofilters..
 
ok.

I think you are confirming what I thought to be the case, though perhaps I
didn't state it well.

thanks.

"Tom Ogilvy" wrote:

No, you apply a filter to a range.




All times are GMT +1. The time now is 05:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com