PC Review


Reply
Thread Tools Rate Thread

Clear Auto Filter on Close (or open)

 
 
=?Utf-8?B?S2FyaW4=?=
Guest
Posts: n/a
 
      23rd Aug 2007
Hi,

How would I ensure that if Auto Filter is on, it is cleared when the
workbook is closed (or opened)? I'm not much of a programmer, but I can copy
and paste!

TIA
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      23rd Aug 2007
Does clear mean show all or remove the filter arrows?

I'm guessing that it means show all (but leave the arrows).

Put something like this in a General module:

Option Explicit
Sub auto_open()
With Worksheets("sheet1")
If .FilterMode Then
.ShowAllData
End If
End With
End Sub

Change the sheet name to match what you need.


Karin wrote:
>
> Hi,
>
> How would I ensure that if Auto Filter is on, it is cleared when the
> workbook is closed (or opened)? I'm not much of a programmer, but I can copy
> and paste!
>
> TIA


--

Dave Peterson
 
Reply With Quote
 
=?Utf-8?B?S2FyaW4=?=
Guest
Posts: n/a
 
      23rd Aug 2007
Dave, Thank you, but it doesn't work. The auto filter remains on. In answer
to your question, I want the auto filter arrows to remain, but to clear any
filtering. I tried modifying your code with .autofiltermode but that didn't
change anything. (I did use my correct worksheet name, which is ClientList.)

"Dave Peterson" wrote:

> Does clear mean show all or remove the filter arrows?
>
> I'm guessing that it means show all (but leave the arrows).
>
> Put something like this in a General module:
>
> Option Explicit
> Sub auto_open()
> With Worksheets("sheet1")
> If .FilterMode Then
> .ShowAllData
> End If
> End With
> End Sub
>
> Change the sheet name to match what you need.
>
>
> Karin wrote:
> >
> > Hi,
> >
> > How would I ensure that if Auto Filter is on, it is cleared when the
> > workbook is closed (or opened)? I'm not much of a programmer, but I can copy
> > and paste!
> >
> > TIA

>
> --
>
> Dave Peterson
>

 
Reply With Quote
 
=?Utf-8?B?S2FyaW4=?=
Guest
Posts: n/a
 
      23rd Aug 2007
It worked! My bad...I didn't put it in a module. Thank you!

"Dave Peterson" wrote:

> Does clear mean show all or remove the filter arrows?
>
> I'm guessing that it means show all (but leave the arrows).
>
> Put something like this in a General module:
>
> Option Explicit
> Sub auto_open()
> With Worksheets("sheet1")
> If .FilterMode Then
> .ShowAllData
> End If
> End With
> End Sub
>
> Change the sheet name to match what you need.
>
>
> Karin wrote:
> >
> > Hi,
> >
> > How would I ensure that if Auto Filter is on, it is cleared when the
> > workbook is closed (or opened)? I'm not much of a programmer, but I can copy
> > and paste!
> >
> > TIA

>
> --
>
> Dave Peterson
>

 
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
clear a filter on close johnlute Microsoft Access Reports 4 6th Sep 2009 02:22 AM
clear filter on open of form deb Microsoft Access Forms 1 15th May 2008 08:33 AM
Using Macro to Open Filter by form, clear grid, then run filter Victoria@DIG Microsoft Access Macros 0 20th Apr 2008 12:46 AM
macro to create toolbar on open and clear it on close =?Utf-8?B?bWlrZQ==?= Microsoft Excel Programming 2 21st Dec 2005 12:12 PM
Clear filter on close Annelie Microsoft Access Reports 2 2nd Nov 2003 02:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:27 PM.