Hi
I've got some code which clears a filter if something has been filtered in the sheet.
However, it shows an error if the filter has NOT been applied and all data is already showing!
Does anyone know why this may be?
The error I get is "ShowAllData method of Worksheet class failed"
I've got some code which clears a filter if something has been filtered in the sheet.
However, it shows an error if the filter has NOT been applied and all data is already showing!
Does anyone know why this may be?
VBA Code:
Sub ClearData
Sheet12.Activate
If ActiveSheet.AutoFilterMode Then ActiveSheet.ShowAllData
Range("d7:d10000").Select
Selection.ClearContents
End Sub
The error I get is "ShowAllData method of Worksheet class failed"