Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    May 2001
    Location
    Oxfordshire
    Posts
    456
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Filters - automatically remove (2003 SP2)

    We have a couple of shared spreadsheets, but some people leave the filters on, occasionally.

    Is there a way of, when closing or opening, of removing the filters.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Filters - automatically remove (2003 SP2)

    In the first place: don't share workbooks. It is a recipe for worksheet corruption.

    You can put the following code in the ThisWorkbook module to turn off filters in all worksheets when the workbook is opened:

    Private Sub Workbook_Open()
    Dim wsh As Worksheet
    For Each wsh In Worksheets
    wsh.AutoFilterMode = False
    If wsh.FilterMode Then
    wsh.ShowAllData
    End If
    Next wsh
    End Sub

  3. #3
    4 Star Lounger
    Join Date
    May 2001
    Location
    Oxfordshire
    Posts
    456
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filters - automatically remove (2003 SP2)

    Cheers Hans. That should do the trick.

    I agree about sharing, but it's not my choice [img]/forums/images/smilies/sad.gif[/img]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •