I am trying to use a check box to turn the autofilter on and off on a spreadsheet.
What I am finding is that the checked box will turn it off. Here is the code that I have:
I tried using an if statement that says when the check box is checked, turn on the filter. When it is unchecked, turn it off. However, it doesn't work that way. with the if statement, I can only run the macro either way when the check box is checked.
The code above will toggle it on and off.
Is there a way to ensure that when the check box is checked, the auto filter is on and when it is empty (unchecked), the filter is turned off?