LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 573
Default Autmatically remove filters from all worksheets

I'm creating spreadsheets that contain buttons/macros to filter for
specific criteria. I want all records/rows to be shown when the
workbook is opened. I have 2 macros to accomplish this. One is attached
to a button which appears on every worksheet to remove any filters.

Sub ShowAll()
'
' ShowAll Macro
' Macro recorded 3/11/2005 by Dave Bellamy

Range("a1:J62").AdvancedFilter Action:=xlFilterInPlace,
CriteriaRange:= _
Range("S5:Z6"), Unique:=False
Range("c4").Select

End Sub

I used blank filter criteria instead of other methods that I found to
remove filters because none of the others worked in a protected sheet.

The second macro goes through all sheets in the workbook and removes
all filters automatically on opening. Or it should. It calls the first
program to do so. I've stepped through the macro, and it goes to both
sheets (I'm testing with 2 sheets, more will come later so I want the
macro to run on however many sheets there are in the workbook). But it
doesn't remove the filter in the second sheet.

Sub Auto_Open()
Dim Wks As Object
For Each Wks In ThisWorkbook.Worksheets
On Error Resume Next
ShowAll
Next Wks
End Sub

Does anyone know what's wrong?

 
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
Remove or delete lists/filters. Champ Excel Discussion (Misc queries) 1 December 10th 09 12:35 PM
Remove filters/lists from multiple columns but not all. Champ Excel Discussion (Misc queries) 0 December 10th 09 06:49 AM
How do I remove auto filters from a file I exported out of Salesfo SusanM Excel Worksheet Functions 0 May 7th 09 06:18 PM
Remove filters Tom Excel Discussion (Misc queries) 5 March 23rd 07 09:57 AM
Filters on Protected Worksheets CiaraG[_3_] Excel Programming 2 November 20th 03 11:10 AM


All times are GMT +1. The time now is 10:52 PM.

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"