auto filter

  • Thread starter Thread starter monika
  • Start date Start date
M

monika

Can I check for a condition that if the sheet has auto
filter for a row then
it should deactivate....i.e. remove the auto filter and if
not found then
leave as it is.

I tried Selection.Autofilter. Using this I can remove the
auto filter if its
present but if not there then it puts it!

How can I check such a case

Thanks
Monika
 
'This shows all the data if the list os filtered
Sub test()
With ActiveSheet
If .FilterMode Then .ShowAllData
End With
End Sub

'This removes the autofilter altogether
Sub test2()
With ActiveSheet
If .AutoFilterMode Then .AutoFilterMode = False
End With
End Sub
 
thanks...!
Rob van Gelder said:
'This shows all the data if the list os filtered
Sub test()
With ActiveSheet
If .FilterMode Then .ShowAllData
End With
End Sub

'This removes the autofilter altogether
Sub test2()
With ActiveSheet
If .AutoFilterMode Then .AutoFilterMode = False
End With
End Sub
 
Back
Top