ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   #DIV?0! in Pivot Table (https://www.excelbanter.com/excel-discussion-misc-queries/254320-div-0-pivot-table.html)

RussellT

#DIV?0! in Pivot Table
 
Sorry for the re-post, forgot to ask the question.

I create Pivot Tables that use calced fields. Sometimes the calced fields
divide zero by zero which results in #DIV/0! showing up in the RowTotals and
TotalTotals. I can use the Table Options For Error Value Show (blank), which
removes the #Div/0! from the table display, the only problem with doing this
is the TotalTotal cells also show up as blank. Here's my code for creating
the calced field.

ActiveSheet.PivotTables("PivotTable2").CalculatedF ields.Add
"Weighted Avg Price", _
"=rev / PosSold"
With ActiveSheet.PivotTables("PivotTable2").PivotFields ("Weighted
Avg Price")
..Orientation = xlDataField
..NumberFormat = "$#,##0"
End With

How can I get the PivotTable to display the TotalTotals when this happens?


All times are GMT +1. The time now is 11:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com