Byg Software

013

 
In VBA, "Selection.AutoFilter" toggles the AutoFilter on and off, depending on which state it is currently in. To start off your code in a known position use the following code:
 
'' ***************************************************************************
'' Purpose  : Turn AutoFilter On at a specific position
'' Written  : 16-Mar-1997 by Andy Wiggins, Byg Software Limited
''
Sub TurnAutoFilterOn()
    '' Make a selection
    '' Ensure the AutoFilter is OFF
    ActiveSheet.AutoFilterMode = False
    '' Turn on the filter in selection
    Selection.AutoFilter
End Sub 
 
Close