ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Format PivotTable from VBA out of MS Access (https://www.excelbanter.com/excel-programming/419505-format-pivottable-vba-out-ms-access.html)

Hannes

Format PivotTable from VBA out of MS Access
 
Hi,
I have created different functions which move certain data from MS Access to
Excel in an PivotTable and PivotChart. The PivotChart formatting works,
however I try now to format the PivotTable itself but it always fails - or at
lesast I don't know what to do exactly. I use version 2002.
Here some samples:

With xlAPP.ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "Title"
End With

Setup of Pivot Table:
With xlAPP.ActiveSheet.PivotTables("PivotIndex")
.PivotFields("Category").Orientation = xlRowField
.PivotFields("Series").Orientation = xlColumnField
.ColumnGrand = False
.RowGrand = False
End With

With xlAPP.ActiveSheet.PivotTables("PivotIndex").PivotF ields("ChartValue")
.Orientation = xlDataField
.Function = xlSum
.Position = 1
End With

However the same for the PivotTable seems not to work: (as mentioned I like
to format the font, size, etc...)

xlAPP.ActiveSheet.PivotTables("PivotIndex").PivotF ields("Series").Font.Name
= "HelveticaNeueLT Std Cn"







All times are GMT +1. The time now is 06:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com