genracela
07-21-2010, 11:49 PM
I'm just wondering, how will you clear filter in macro?
My original code is:
Sub FilterB6()
Dim fld
Application.ScreenUpdating = False
If UCase(Range("B5").Value) <> "ALL" Then
Range("A5:AA5").AutoFilter Field:=2, Criteria1:=Range("A3"), visibledropdown:=False
With ActiveSheet.AutoFilter
For fld = 1 To 27
If Not .Filters(fld).On Then
Range("A5:AA5").AutoFilter Field:=fld, visibledropdown:=False
End If
Next fld
End With
Else
If ActiveSheet.AutoFilterMode Then
Range("A5:AA5").AutoFilter
End If
End If
Application.ScreenUpdating = True
Range("A1").Select
End Sub
I want to create another code that will clear the filter
Thanks!!!
My original code is:
Sub FilterB6()
Dim fld
Application.ScreenUpdating = False
If UCase(Range("B5").Value) <> "ALL" Then
Range("A5:AA5").AutoFilter Field:=2, Criteria1:=Range("A3"), visibledropdown:=False
With ActiveSheet.AutoFilter
For fld = 1 To 27
If Not .Filters(fld).On Then
Range("A5:AA5").AutoFilter Field:=fld, visibledropdown:=False
End If
Next fld
End With
Else
If ActiveSheet.AutoFilterMode Then
Range("A5:AA5").AutoFilter
End If
End If
Application.ScreenUpdating = True
Range("A1").Select
End Sub
I want to create another code that will clear the filter
Thanks!!!