gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,332
- Office Version
- 365
- Platform
- Windows
I have a simple code that clears all the filters/slicers that I tied to a button on the sheet. My problem is that if nothing is filtered and someone clicks the button I get a debug error. Is there a way to not run the code if nothing is filtered or to just not show or have the error popup if nothing is filtered?
Run-time error '1004':
ShowAllData method of worksheet class failed.
Thanks!
Run-time error '1004':
ShowAllData method of worksheet class failed.
Code:
Sub ClearAllFilters()
'GH
Range("B11").Select
ActiveSheet.ShowAllData
End Sub
Thanks!