I notice my VBA script doesn\'t work when there\'s an autofilter already on. Any idea why this is?
wbk.Activate Set Criteria = Sheets(\"Sheet1\").Cel
The simple way to avoid this is not to use the worksheet method ShowAllData
Autofilter has the same ShowAllData method which doesn't throw an error when the filter is enabled but no filter is set
If ActiveSheet.AutoFilterMode Then ActiveSheet.AutoFilter.ShowAllData