PivotTable.PreserveFormatting (Excel)

True if formatting is preserved when the report is refreshed or recalculated by operations such as pivoting, sorting, or changing page field items.

For database query tables, the default formatting setting is the xlSimple constant. The new AutoFormat style is applied to the query table when the table is refreshed. The AutoFormat is reset to None whenever PreserveFormatting is set to False. As a result, any AutoFormat that's set before PreserveFormatting is set to False and before the query table is refreshed doesn't take effect, and the resulting query table has no formatting applied to it.


ActiveCell.PivotTable.PreserveFormatting = True