Macro to check auto filter - if on, turn off...if off, do nothing

Self-taught macros here - but can't figure out how to do this.  My macro button is supposed to check to see if the auto filters are on - if they are, turn them off, if not, do nothing.  Anybody?  Thanks for the help!

Rows("5:5").Select
    Selection.AutoFilter
End Sub

Answer
Answer

Hi,

use the following macro:

Sub TurnAutofilterOFF()
  ActiveSheet.AutoFilterMode = False
End Sub

 

Regards,

Frank


If this post answers your question, please mark it for all readers as the Answer or vote if the reply has been helpful.

If this post answers your question, please mark it as the answer or vote it as helpfull.

15 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated February 15, 2024 Views 11,966 Applies to: