Jagat Pavasia
Active Member
- Joined
- Mar 9, 2015
- Messages
- 359
- Office Version
- 2021
- Platform
- Windows
Sub ClearAllFilter()
'
' ClearAllFilter Macro
'
'
ActiveSheet.Unprotect
ActiveSheet.ShowAllData
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
False, AllowFormattingCells:=True, AllowFiltering:=True
End Sub
I have upon VBA code to clear all filter, I have also created button to do this.
and it is working as it should be.
But, when no filter are in sheet and i pressed button then error display below:
Run-time error '1004':
ShowAllData method of workshrrt class failed
please help me to resolve ths error..
'
' ClearAllFilter Macro
'
'
ActiveSheet.Unprotect
ActiveSheet.ShowAllData
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
False, AllowFormattingCells:=True, AllowFiltering:=True
End Sub
I have upon VBA code to clear all filter, I have also created button to do this.
and it is working as it should be.
But, when no filter are in sheet and i pressed button then error display below:
Run-time error '1004':
ShowAllData method of workshrrt class failed
please help me to resolve ths error..