我有RowField
,这将是dddd, mmmm dd yyyy
。它包含string
格式的日期,可能是.PivotFilters.Add Type:=xlValueIsBetween
,因为我无法使用.PivotFilters.Add Type:=xlDateBetween
或RowLabel
等过滤日期。如果您想知道我的旅程这个结论,你会发现它here。
现在我的新计划是创建一个新的Double
,其日期为long
格式,然后在那里过滤日期。
使用以下代码,将此double
格式转换为i.Caption
格式非常有效,我只能覆盖.PivotFilters.Add
值。但是For Each i In .PivotItems
Debug.Print i.Caption 'in Format dddd, mmmm dd yyyy
p = i.Caption
u = Split(p, ",")(1)
Debug.Print CDate(u) 'e.g. 04/09/2017
i.Caption = CDbl(CDate(u)) 'here should be the new RowLabel which should be filled
Next i
也不适用于此配置。
{{1}}