I have a code that builds my pivottable, and I want to set one of the fields as italic but i cant figure out how.
The code I have is like this from the begining:
With ActiveSheet.PivotTables("Laddsida").PivotFields("Work hrs")
.Orientation = xlDataField
.Position = 6
.Function = xlSum
.NumberFormat = "[h]:mm:ss"
.Name = "Uppskattad arbetad tid"
End With
Have tried with this:
With ActiveSheet.PivotTables("Laddsida").PivotFields("Work hrs")
.Orientation = xlDataField
.Position = 6
.Function = xlSum
.NumberFormat = "[h]:mm:ss"
.font.Italic = True
.Name = "Uppskattad arbetad tid"
End With
But get the following error:
Run-time error"438":
Object doesn't support this porperty or method