CalRich1023
New Member
- Joined
- Mar 15, 2021
- Messages
- 48
- Office Version
- 365
- Platform
- Windows
- MacOS
Hello,
I have a Pivot Table that I would like 3 columns center aligned on, but I can't seem to get it working. It gives me an error every time I run it. Could someone point out my mistake here?
Thank you!
I have a Pivot Table that I would like 3 columns center aligned on, but I can't seem to get it working. It gives me an error every time I run it. Could someone point out my mistake here?
Thank you!
VBA Code:
Sub PivotTable_Collapse()
Dim pT As PivotTable
Dim pF As PivotField
Set pT = ActiveSheet.PivotTables(1)
With pT
For Each pF In pT.RowFields
pF.DrillTo pF.Name
Next pF
End With
'GENERAL FORMATTING
Range("M6:O").Select
With Selection
.HorizontalAlignment = xlCenter
End With
End Sub