![]() |
![]() |
|
|||||||
| 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 |
|
Board Regular
Join Date: Feb 2002
Location: England
Posts: 212
|
Using code how can i firstly check to see if the autofilter is on and then if the filter is on, switch off so all records are showing.
hope someone can help thanks Matt |
|
|
|
|
|
#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 |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: England
Posts: 212
|
Cheers Ricky
|
|
|
|
|
|
#4 |
|
Board Regular
Join Date: May 2002
Posts: 63
|
Here's another way...
If Sheets("Sheet1").FilterMode = True Then _ Sheets("Sheet1").ShowAllData |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Feb 2002
Location: England
Posts: 212
|
Cheers
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|