![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Feb 2002
Location: Netherlands
Posts: 3
|
Is there a code to turn Autofilter off
I mean: "Selection.AutoFilter" turns it either on or off depending on the status. I need a code the always turns it off and not on. |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Posts: 363
|
Try this:
Sub FilterOff() On Error Resume Next ActiveSheet.ShowAllData If Err.Description = "ShowAllData method of Worksheet class failed" Then Selection.AutoFilter endif End Sub _________________ It's never too late to learn something new. Ricky [ This Message was edited by: Ricky Morris on 2002-04-17 10:04 ] |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Apr 2002
Location: Cape Town,South Africa
Posts: 234
|
Hello buddy
Did you try this already ? Sub FilterOff() On Error Resume Next ActiveSheet.ShowAll If Err.Description = "ShowAllData method of Worksheet class failed" Then Selection.AutoFilter End Sub |
|
|
|
|
|
#4 | |
|
Board Regular
Join Date: Jul 2003
Location: San Francisco
Posts: 112
|
Quote:
Object Doesnt support this property or method Error.. |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|