freeze width of a column used by pivot table

A

Atiq

Hi,

i'm using a pivot table report and want to fix the length of columns used in
that pivot table. is there any way to fix the width. i.e. when i refresh the
table, width of the columns should not increase. i dont need to show the full
contents of the text in those columns.

thanks,
 
F

FSt1

hi
freezing the columns so that they cannot be change may not be possible but
you might be able to use the worksheet change event to reset the columns to a
preset width so that when any change on the sheet occurs, the columns reset.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Columns("E:E").ColumnWidth = 18
Columns("F:F").ColumnWidth = 14
End Sub

you did not mention specific column or widths so you might use this code as
an example, adding your columns and playing with the widths until they are to
your liking.

Regards
FSt1
 
F

FSt1

hi
forgot to mention.
this is sheet code so it does not go into a standard module.
right click the sheet tab then click view code from the popup. paste there.

regards
FSt1
 
R

roni

hi
forgot to mention.
this is sheet code so it does not go into a standard module.
right click the sheet tab then click view code from the popup. paste there.

regards
FSt1







- Show quoted text -

Try working with the pivot tables in SiSense http://www.sisense.com.
they are easier to use and can use excel as a data source
 
A

Atiq

Thanks, it did work! appreicate that.

however, just to save time on refreshing rate, if have used your code under
"Worksheet_PivotTableUpdate" instead of "Worksheet_SelectionChange". i am
still experimenting and hopefully wont see any drawback of the change i've
made in the code.

thanks again.
Atiq Ahmed
 

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