excel vba‎ > ‎

Autofilter

posted Feb 20, 2020, 6:10 AM by Roberto Felicini

Turn off Autofilter in VBA
 
Public Sub KillFilter()
If ActiveSheet.AutoFilterMode Then
     ActiveSheet.AutoFilterMode = False
End If
End Sub

Turn on Autofilter in VBA

Public Sub StartFilter()
If Not ActiveSheet.AutoFilterMode Then
     ActiveSheet.Range("A1").AutoFilter
End If
End Sub



Comments