我做了一个过滤三列的宏。我只得到空白字段。
在手动进入三个过滤器选择(宏已经完成)并在所有三个上单击“OK”后,显示数据。
日期格式:02.01.2023
Sub Filter_Date()
Dim ws As Worksheet: Set ws = Sheets("Source Data")
Dim rg As Range: Set rg = ws.Range("A12:AA2758")
rg.AutoFilter 25, "<=" & DateSerial(2023, 12, 30), xlAnd, "<>" & DateSerial(2022, 12, 31)
rg.AutoFilter 26, "<=" & Date + 7, xlOr, "unconfirmed"
rg.AutoFilter 27, "<=" & Date - 5
End Sub
1条答案
按热度按时间uxhixvfz1#
将日期转换为Double