Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default detecting the state of filters

I have a macro in Excel which needs to ensure that autofilters are on
a worksheet certain times and turned off at other times.

At the moment I am just changing the state of the filters with:

Sheets(1).Rows("1:1").AutoFilter

So if filters are on, then this command will turn them off and vice
versa. I need some kind of check to tell whether or not the filters
are on my sheet. Any suggestions.

Thanks in advance.
Chris
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default detecting the state of filters

One mo

You can check if the worksheet has had filters applied. And you can even check
to see if any of the filters are in use:

With ActiveSheet
If .AutoFilterMode Then
MsgBox "Has dropdown Arrows!"
If .FilterMode Then
MsgBox "Some filter is active!"
End If
End If
End With

Or if you think that it might have been changed, you can just turn it off and
apply it where you want:

with activesheet
.autofiltermode = false
.range("w12:al12").autofilter
end with

Although I like choosing my whole range when I apply the autofilter.

Chris Spencer wrote:

I have a macro in Excel which needs to ensure that autofilters are on
a worksheet certain times and turned off at other times.

At the moment I am just changing the state of the filters with:

Sheets(1).Rows("1:1").AutoFilter

So if filters are on, then this command will turn them off and vice
versa. I need some kind of check to tell whether or not the filters
are on my sheet. Any suggestions.

Thanks in advance.
Chris


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
replace state names with state code abbreviations se7098 Excel Worksheet Functions 3 July 25th 09 06:41 PM
How can I show state-by-state data (as silos) on a map of NA Rob Charts and Charting in Excel 0 November 5th 07 03:41 PM
Converting State Names to State Abbreviations aznate Excel Discussion (Misc queries) 1 October 20th 06 06:52 AM
Filters, Subtotal & Intacted Results after the filters' Removal kasiopi Excel Discussion (Misc queries) 5 February 24th 06 12:18 PM
Detecting Calculation State Chris Gorham[_2_] Excel Programming 3 July 15th 03 11:40 AM


All times are GMT +1. The time now is 01:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"