CaptionHAlignment

L

lucia

Hello,

I'm trying to align the caption of the pivot table. I
found an example in the MSDN library documentation (as
below) but the caption alignment didn't work

Sub Set_Total_Alignment()
Dim ptConstants
Dim vwView
Dim totTotal

Set ptConstants = PivotTable1.Constants
Set vwView = PivotTable1.ActiveView

' Loop through all totals in the view.
For Each totTotal in vwView.DataAxis.Totals
' this line below worked
totTotal.HAlignment = ptConstants.plHAlignCenter
' this line below didn't work
totTotal.CaptionHAlignment =
ptConstants.plHAlignCenter
Next
End Sub

Can anyone help? The solution given by MSDN is not
working.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top