ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   column width (https://www.excelbanter.com/excel-discussion-misc-queries/210615-column-width.html)

hazel

column width
 
I have created a spreadsheet where every column has a different width. After
adjusting the width, I saved it. Every time I sort the spreadsheet, the
column width changes at will and I have to go through and adjust them again.
There is no pattern to it. They just change at random. What can I do to get
my adjustments to take?
--
Hazel

JMay

column width
 
Such as (?)...

Private Sub Worksheet_Activate()
Me.Columns("A:C").ColumnWidth = 10
Me.Columns("D").ColumnWidth = 5
Me.Columns("E").ColumnWidth = 25
Me.Columns("F").ColumnWidth = 50
Me.Columns("G:L").ColumnWidth = 3
End Sub

HTH

"Hazel" wrote:

I have created a spreadsheet where every column has a different width. After
adjusting the width, I saved it. Every time I sort the spreadsheet, the
column width changes at will and I have to go through and adjust them again.
There is no pattern to it. They just change at random. What can I do to get
my adjustments to take?
--
Hazel


hazel

column width
 
Jay--I appreciate your response (this is really driving me crazy!) But I
don't understand it.
--
Hazel


"JMay" wrote:

Such as (?)...

Private Sub Worksheet_Activate()
Me.Columns("A:C").ColumnWidth = 10
Me.Columns("D").ColumnWidth = 5
Me.Columns("E").ColumnWidth = 25
Me.Columns("F").ColumnWidth = 50
Me.Columns("G:L").ColumnWidth = 3
End Sub

HTH

"Hazel" wrote:

I have created a spreadsheet where every column has a different width. After
adjusting the width, I saved it. Every time I sort the spreadsheet, the
column width changes at will and I have to go through and adjust them again.
There is no pattern to it. They just change at random. What can I do to get
my adjustments to take?
--
Hazel


Satti Charvak[_2_]

column width
 
Hi Hazel,
That was basically a macro.

now, if you don't know anhthing about macro's...i'll give you some idea to
use them.

open the excel sheet

now hit ALT+F11 (Function key f-11)

now on the left side you would see 3 worksheets ,
select a sheet where you want the code now after you select a sheet by
double clicking. Now after that you would see some are appearing on the right.

This is the place where you paste the code.

you can run the code by using the F5 key this time. and the code will
anyways runs everytime the worksheet is selected.

also regarding the code,

the line

Me.Columns("A:C").ColumnWidth = 10

mean to select columns a to c and set there width to 10 points.

the line

Me.Columns("D").ColumnWidth = 5

means to select only column d and set it's width to 5 point


alos, one important thing. please go to macro security and enable the macros
otherwise the code wouldnot run.


--
Kind Regards,
Satti Charvak
Only an Excel Enthusiast
Noida, India


"Hazel" wrote:

Jay--I appreciate your response (this is really driving me crazy!) But I
don't understand it.
--
Hazel


"JMay" wrote:

Such as (?)...

Private Sub Worksheet_Activate()
Me.Columns("A:C").ColumnWidth = 10
Me.Columns("D").ColumnWidth = 5
Me.Columns("E").ColumnWidth = 25
Me.Columns("F").ColumnWidth = 50
Me.Columns("G:L").ColumnWidth = 3
End Sub

HTH

"Hazel" wrote:

I have created a spreadsheet where every column has a different width. After
adjusting the width, I saved it. Every time I sort the spreadsheet, the
column width changes at will and I have to go through and adjust them again.
There is no pattern to it. They just change at random. What can I do to get
my adjustments to take?
--
Hazel



All times are GMT +1. The time now is 07:11 PM.

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