PC Review


Reply
Thread Tools Rate Thread

autofilter help

 
 
Gary Keramidas
Guest
Posts: n/a
 
      21st Oct 2006
how do i tell if an autofilter is applied so i can reset it when the file is
saved?

--


Gary



 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      21st Oct 2006
If Worksheets("Sheet1").AutoFilterMode Then
isOn = "On"
Else
isOn = "Off"
End If
MsgBox "AutoFilterMode is " & isOn

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Gary Keramidas" <GKeramidasATmsn.com> wrote in message
news:euwd#$(E-Mail Removed)...
> how do i tell if an autofilter is applied so i can reset it when the file

is
> saved?
>
> --
>
>
> Gary
>
>
>



 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      21st Oct 2006
You may want to reset the autofilter when the workbook is opened--not saved. (I
save lots of times and would hate to have my filtering change each time I save.

One way is to ignore any error that may occur:

Option Explicit
Sub auto_open()
Dim wks As Worksheet
On Error Resume Next
For Each wks In ThisWorkbook.Worksheets
wks.ShowAllData
Next wks
On Error GoTo 0
End Sub

Another way is to check to see if things need to be reset first:

Option Explicit
Sub auto_open()
Dim wks As Worksheet
For Each wks In ThisWorkbook.Worksheets
If wks.AutoFilterMode Then
If wks.FilterMode Then
wks.ShowAllData
End If
End If
Next wks
End Sub

Gary Keramidas wrote:
>
> how do i tell if an autofilter is applied so i can reset it when the file is
> saved?
>
> --
>
> Gary


--

Dave Peterson
 
Reply With Quote
 
Gary Keramidas
Guest
Posts: n/a
 
      21st Oct 2006
thanks for the idea, i'll keep it mind

--


Gary


"Dave Peterson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> You may want to reset the autofilter when the workbook is opened--not saved.
> (I
> save lots of times and would hate to have my filtering change each time I
> save.
>
> One way is to ignore any error that may occur:
>
> Option Explicit
> Sub auto_open()
> Dim wks As Worksheet
> On Error Resume Next
> For Each wks In ThisWorkbook.Worksheets
> wks.ShowAllData
> Next wks
> On Error GoTo 0
> End Sub
>
> Another way is to check to see if things need to be reset first:
>
> Option Explicit
> Sub auto_open()
> Dim wks As Worksheet
> For Each wks In ThisWorkbook.Worksheets
> If wks.AutoFilterMode Then
> If wks.FilterMode Then
> wks.ShowAllData
> End If
> End If
> Next wks
> End Sub
>
> Gary Keramidas wrote:
>>
>> how do i tell if an autofilter is applied so i can reset it when the file is
>> saved?
>>
>> --
>>
>> Gary

>
> --
>
> Dave Peterson



 
Reply With Quote
 
Gary Keramidas
Guest
Posts: n/a
 
      21st Oct 2006
thanks, bob, i guess it was pretty simple

--


Gary


"Bob Phillips" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> If Worksheets("Sheet1").AutoFilterMode Then
> isOn = "On"
> Else
> isOn = "Off"
> End If
> MsgBox "AutoFilterMode is " & isOn
>
> --
>
> HTH
>
> Bob Phillips
>
> (replace xxxx in the email address with gmail if mailing direct)
>
> "Gary Keramidas" <GKeramidasATmsn.com> wrote in message
> news:euwd#$(E-Mail Removed)...
>> how do i tell if an autofilter is applied so i can reset it when the file

> is
>> saved?
>>
>> --
>>
>>
>> Gary
>>
>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel 2007 autofilter change to 2003 autofilter functionality? jonnybrovo815 Microsoft Excel Misc 1 19th Apr 2010 10:05 PM
2007 excel autofilter back to 2003 autofilter? jonnybrovo815 Microsoft Excel Misc 3 19th Apr 2010 08:11 PM
2007 excel autofilter change back to 2003 autofilter? jonnybrovo815 Microsoft Excel Misc 1 19th Apr 2010 05:53 PM
2007 Autofilter worse than 2003 Autofilter =?Utf-8?B?anNreQ==?= Microsoft Excel Misc 9 31st Oct 2007 12:14 AM
How to Sort within AutoFilter with Protection on (and AutoFilter . =?Utf-8?B?Z2libG9u?= Microsoft Excel Misc 1 16th Feb 2006 12:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:17 AM.