View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Atiq Atiq is offline
external usenet poster
 
Posts: 24
Default freeze width of a column used by pivot table

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


"FSt1" wrote:

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

"FSt1" wrote:

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

"Atiq" wrote:

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,