Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pivot Table Formating

Status
Not open for further replies.

peachmelba

Programmer
Jan 4, 2002
43
0
0
GB
Has anyone managed to format a pivot table from code.

I have managed to format the labels and the data but can not find a way of formating the totals.

Currently I use for the labels:-

pvtField.LabelRange.Font.Bold = True
pvtField.LabelRange.Interior.Color = intcolGroupBy
pvtField.LabelRange.WrapText = True
pvtField.DataRange.Font.Bold = True
pvtField.DataRange.Interior.Color = intcolGroupBy

and

For Each pvtField In pvtTable.DataFields
pvtField.DataRange.Interior.Color = intcolAuto
pvtField.DataRange.Borders.Color = 0
Next pvtField

for the data fields. I need to do the same for the Sub Totals. Anyone have any ideas????

Regs

Peachmelba [evil]
 
Hi,

In Excel 97 I use rowgrand and columngrand to select the subtotals and turn them on or off eg.

With ActiveSheet.PivotTables("PivotTable1")
.ColumnGrand = False
.RowGrand = False
End With

I don't know if that is sueful to you or not.

Regards,

Alan
 
Alan

Thanks for the response but that does not work.

I think it is something to do with the pvtTable.DataBodyRange but i have not yet looked into this.

Regs

Peachmelba
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top