Hi all,
I´m trying to build in an error check for a simple macro that will clear all filters. For this I created a Userform, added some bottons, assigned the relevant Makros to them and Bob´s your Unlcle.
Works great bu then I noticed if I don´t have any filters set and click the "Clear Filter" button, it throws me an error.
So I´m trying to catch and test for the error and in the event that it happens, it should just jump to the end of the makro.
Makro used to be this
Now I´m trying to cathc the error and thought this should work, but it doesnt
Any suggestions ? The error code is 1004
I´m trying to build in an error check for a simple macro that will clear all filters. For this I created a Userform, added some bottons, assigned the relevant Makros to them and Bob´s your Unlcle.
Works great bu then I noticed if I don´t have any filters set and click the "Clear Filter" button, it throws me an error.
So I´m trying to catch and test for the error and in the event that it happens, it should just jump to the end of the makro.
Makro used to be this
Code:
Sub RemFilter()
ActiveSheet.ShowAllData
End Sub
Now I´m trying to cathc the error and thought this should work, but it doesnt
Code:
Sub RemFilter()
If Not IsError(ActiveSheet.ShowAllData) Then
ActiveSheet.ShowAllData
Else
End If
End Sub
Any suggestions ? The error code is 1004