Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Remove or delete lists/filters. | Excel Discussion (Misc queries) | |||
Remove filters/lists from multiple columns but not all. | Excel Discussion (Misc queries) | |||
How do I remove auto filters from a file I exported out of Salesfo | Excel Worksheet Functions | |||
Remove filters | Excel Discussion (Misc queries) | |||
Filters on Protected Worksheets | Excel Programming |