Autofilter with column formatted as date

前端 未结 10 1742
遥遥无期
遥遥无期 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:29

    One solution is to set up correctly the format of the target column. If its formatted as "custom", even if it looks like a date, it won't work.

    You are asking VBA to filter based on a date, therefore the format of the columns has to be a date too.

提交回复
热议问题