I'm trying to get a pivot table to return the smallest value from a column called # of Units. The code I have currently is returning zeros with the Min function, how do I get it to ignore zero values and just return non-zero values from the desired column?
Thanks!
VBA Code:
ActiveSheet.PivotTables("PivotTableA").AddDataField ActiveSheet.PivotTables("PivotTableA").PivotFields("# of Units"), "Min of Total Units", xlMin
With ActiveSheet.PivotTables("PivotTableA").PivotFields("Min of Total Units")
.NumberFormat = "#,##0.00"
End With
Thanks!