我正在尝试按两列排序。当前状态和批准日期。批准日期必须是当前日期。
当我尝试调试代码时,当我添加手表以查看分配的日期时,它显示例如 2013 年 8 月 11 日,这与我在电子表格中的某些单元格的内容相同,这些单元格也符合当前状态条件,但当它打算将它们保留在那里时,它仍然会将它们过滤掉。有没有理由为什么这不起作用?
Dim w As Integer, b As Integer, rngData2 As Range
Set rngData2 = Range("A1").CurrentRegion
w = Application.WorksheetFunction.Match("Current State", Range("A1:AZ1"), 0)
b = Application.WorksheetFunction.Match("Approved Date", Range("A1:AZ1"), 0)
rngData2.AutoFilter Field:=w, Criteria1:=Array( _
"Approved", "Detailed Impact Assessment", "Draft – Yet to be Tabled at CCCM", _
"Initial Impact Assessment", "New", "On Hold", "Pending Approval - Execution", _
"Pending Approval - IIA"), Operator:=xlFilterValues
rngData2.AutoFilter Field:=b, Criteria1:=Array( _
Date, "TBC"), Operator:=xlFilterValues