Pivot table column widths

F

Fred Smith

I have a pivot table with nice compact column widths, formatted with Table4.

When I choose a specific page field, the all column widths are adjusted to the
size of the field chosen.

If I turn off Autoformat table in Table Options, that stops the columns from
being resized, but it also deletes the table formatting (bold, colors, etc.)

Is there a way to stop the column widths from being resized, but keep the format
of the table?

The table is created in a macro, so if the solution involves VBA, that would be
fine.
 
D

Debra Dalgleish

You could record a macro as you set the column widths, then run that
when the pivot table is updated or the page field is changed. To run the
code automatically, you could add it to the worksheet module for the
pivot table sheet (right-click on the sheet tab, choose View Code).

For example, if you record a macro and name it ResetColumns:

'========
Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
ResetColumns
End Sub
'========
 

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