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.
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.