Hi

The code below produced a nice Pivot Table for me but all the data in the data field "Number of Heats won against" comes out as a "Value" meaning any number is shown as "1" rather than the actual number. How do I get the Field Value for "Number of Heats won against" to be "Max" please??

Sub PivotHeats()
Dim ws As Worksheet
Dim wb As Workbook
Dim pc As PivotCache
Dim pt As PivotTable
Dim LastRow As Long
Dim LastColumn As Long

Set ws = Sheets("Results")
Set wb = ThisWorkbook

Set pc = wb.PivotCaches.Create(SourceType:=xlDatabase, SourceData:=Range("Y:AE"), _
    Version:=xlPivotTableVersion15)

Set pt = ws.PivotTables.Add(PivotCache:=pc, tabledestination:=Range("BL1"), TableName:="HeatsWon")

With pt

.PivotFields("Team").Orientation = xlRowField
.PivotFields("Opposition").Orientation = xlColumnField
.PivotFields("Number of Heats won against").Orientation = xlDataField
.PivotFields("Division").Orientation = xlPageField
.DataBodyRange.NumberFormat = "0"

End With

End Sub

Cheers

Frankie