简体   繁体   中英

Excel macro skips step in Pivot Table

I want to make a simple macro that makes Pivot Table and then creates graph from it. When I insert the 'Date Occurance' in Axis Fields(row) in pivot table, macro has the step in its code, but does not run it when I run the macro. Graph is created without the 'Date Occurance' and when I check the Pivot Table, 'Date Occurance' is absent from required field.

With ActiveSheet.PivotTables("PivotTable2").PivotFields("Date Occurred")
    .Orientation = xlRowField
    .Position = 1
End With
With ActiveSheet.PivotTables("PivotTable2").PivotFields("Specific Info 2")
    .Orientation = xlRowField
    .Position = 2
End With

With ActiveSheet.PivotTables("PivotTable2").PivotFields("Application Name")
    .Orientation = xlColumnField
    .Position = 1
End With

Thank You

您的宏代码可能具有“发生日期”并且您的字段实际上是“发生日期”的事实。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM