Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88301

Change fontstyle on PivotField Excel VBA

$
0
0

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


Viewing all articles
Browse latest Browse all 88301

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>