Autofilter with column formatted as date

前端 未结 10 1708
遥遥无期
遥遥无期 2020-11-27 21:58

I am using an AutoFilter with VBA in Excel that works for regular filters, but not a column formatted as date.

I can filter it manually. If I run my code, it filters

10条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-27 22:20

    here's the occam's razor solution... try putting this in Autoopen for the spreadsheet or if you need to, modify it for the sheet that you wish to affect. it will cause the drop down filters for the date headers to appear as individual dates and not as a date hierarchy.

    ActiveWindow.AutoFilterDateGrouping = False

提交回复
热议问题