I have a code to clear the filter (copied from another code I created last year and have been working fine all the time).
ISSUE: The code is not consistently detecting the filters. Below is the code.
If Worksheets("ABC").FilterMode = True Then
ActiveSheet.ShowAllData
End If
When I run my code step by step,when the code reached the IF statement code line for FilterMode, for some reason it directly goes to the ENF if line inspite of the fact that the worksheet has filters. Sometime it catches though but not consistent all the time.
What shall I do that it detects the filter all the time.
Please advice.
Thanks in advance
ISSUE: The code is not consistently detecting the filters. Below is the code.
If Worksheets("ABC").FilterMode = True Then
ActiveSheet.ShowAllData
End If
When I run my code step by step,when the code reached the IF statement code line for FilterMode, for some reason it directly goes to the ENF if line inspite of the fact that the worksheet has filters. Sometime it catches though but not consistent all the time.
What shall I do that it detects the filter all the time.
Please advice.
Thanks in advance