如何使用olapcube和vba中的数据在数据透视表中创建新的行标签?

时间:2017-09-12 13:32:16

标签: excel vba excel-vba pivot-table olap

我有RowField,这将是dddd, mmmm dd yyyy。它包含string格式的日期,可能是.PivotFilters.Add Type:=xlValueIsBetween,因为我无法使用.PivotFilters.Add Type:=xlDateBetweenRowLabel等过滤日期。如果您想知道我的旅程这个结论,你会发现它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}}

0 个答案:

没有答案