XLA routines: EE_PivotArrangeDataFields

Nick's picture
EE_PivotArrangeDataFields allows you to add data fields to your pivot in the format you want.
Sub EE_PivotArrangeDataFields(pt As PivotTable, strField As String, strDisplayName As String, lngSummariseOperation As PvtDataCalc, strNumberFormat As String)
'- as above
'- takes an array of data fields, a new name for them, the 'sum' 'count' etc.. , and
'the Format

'http://excelexperts.com/xla-routines-eeCreatePivotFromCSV    for updates on this sub routine

    With pt
        .AddDataField .PivotFields(strField), strDisplayName, lngSummariseOperation
        .PivotFields(strDisplayName).NumberFormat = strNumberFormat
    End With
End Sub