Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default autofilter help

how do i tell if an autofilter is applied so i can reset it when the file is
saved?

--


Gary



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 380
Default autofilter help

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
...
how do i tell if an autofilter is applied so i can reset it when the file

is
saved?

--


Gary





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default autofilter help

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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default autofilter help

thanks for the idea, i'll keep it mind

--


Gary


"Dave Peterson" wrote in message
...
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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default autofilter help

thanks, bob, i guess it was pretty simple

--


Gary


"Bob Phillips" wrote in message
...
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
...
how do i tell if an autofilter is applied so i can reset it when the file

is
saved?

--


Gary







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
excel 2007 autofilter change to 2003 autofilter functionality? jonnybrovo815 Excel Discussion (Misc queries) 1 April 19th 10 10:05 PM
2007 excel autofilter back to 2003 autofilter? jonnybrovo815 Excel Discussion (Misc queries) 3 April 19th 10 08:11 PM
2007 excel autofilter change back to 2003 autofilter? jonnybrovo815 Excel Discussion (Misc queries) 1 April 19th 10 05:53 PM
2007 Autofilter worse than 2003 Autofilter jsky Excel Discussion (Misc queries) 9 October 31st 07 12:14 AM
How to Sort within AutoFilter with Protection on (and AutoFilter . giblon Excel Discussion (Misc queries) 1 February 16th 06 12:23 PM


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

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

About Us

"It's about Microsoft Excel"