I created a pivot table via VBA and I want to set this checkbox to true within the VBA. I can manually do this by going PivotTable Options-Display but I have over 100 pivot tables so I was hoping there was a better way to do it.
Any suggestions would be greatly appreciated?
Any suggestions would be greatly appreciated?
Code:
ActiveSheet.PivotTableWizard xlDatabase, rng, TableName:=colHeader
Set objTable = ActiveSheet.PivotTables(colHeader)
objTable.ColumnGrand = False
objTable.RowGrand = False
objTable.DisplayFieldCaptions = True
'is there anything like objTable.Display Item Labels when no fields are in the values area = True ?
Set objField = objTable.PivotFields(colHeader)
objField.Orientation = xlRowField
objField.Position = 1