Macro is not effective with Date Format Column?

0

I have written this macro to UNDO any Filters Before saving the spreadsheet.

Here is my code:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If ActiveSheet.FilterMode Then
ActiveSheet.ShowAllData
End If
End Sub

It is working fine when I add Filter to a column and then click Save, The Filter is automatically removed. However, If I add Filter to a Date Format column, same does not happen. Any idea, why and what can be done to remedy the situation.

Thank you very much for your precious time and in apprehension of your help.

Best Regads

WhiteRose

Posted 2019-09-05T13:56:54.127

Reputation: 23

"However, If I add Filter to a Date Format column, same does not happen" - after you click Save? – spikey_richie – 2019-09-05T14:13:53.833

Yes after I click save. – WhiteRose – 2019-09-05T15:01:42.317

If that column is in a table then the filter may belong to the table and not the worksheet. – ProfoundlyOblivious – 2019-09-08T16:08:30.307

No answers