ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   freeze width of a column used by pivot table (https://www.excelbanter.com/excel-discussion-misc-queries/192181-freeze-width-column-used-pivot-table.html)

Atiq

freeze width of a column used by pivot table
 
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,

FSt1

freeze width of a column used by pivot table
 
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,


FSt1

freeze width of a column used by pivot table
 
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,


[email protected]

freeze width of a column used by pivot table
 
On Jun 22, 6:30*pm, 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,- Hide quoted text -


- 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

Atiq

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,



All times are GMT +1. The time now is 01:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com