ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   AUTOMATICALLY ADJUST COLUMN WIDTHS TO CONTENT (https://www.excelbanter.com/excel-worksheet-functions/229705-automatically-adjust-column-widths-content.html)

DebC

AUTOMATICALLY ADJUST COLUMN WIDTHS TO CONTENT
 
I use Microsoft Office 2003. Is there a way to get columns to automatically
adjust to fit the content of the cell?

Bernard Liengme[_3_]

AUTOMATICALLY ADJUST COLUMN WIDTHS TO CONTENT
 
Double click the separator between the column and the one to the right
or
Select all the columns and use Format | Columns | AutoAdjust

I know of no way to make Excel automatically widen a column to hold any
amount of test entered into it.
best wishes

--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"DebC" wrote in message
...
I use Microsoft Office 2003. Is there a way to get columns to automatically
adjust to fit the content of the cell?




DebC

AUTOMATICALLY ADJUST COLUMN WIDTHS TO CONTENT
 
Thank you; that is sort of what I thought, but hoped someone would be able to
tell me differently! hehe Thank you so much.

"Bernard Liengme" wrote:

Double click the separator between the column and the one to the right
or
Select all the columns and use Format | Columns | AutoAdjust

I know of no way to make Excel automatically widen a column to hold any
amount of test entered into it.
best wishes

--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"DebC" wrote in message
...
I use Microsoft Office 2003. Is there a way to get columns to automatically
adjust to fit the content of the cell?





Rich/rerat

AUTOMATICALLY ADJUST COLUMN WIDTHS TO CONTENT
 
DebC,

Right click the Sheet tab Select View Code Copy and paste the following:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim myRange As Range
Set myRange = Range("a1:m100")

' Adjust Range to Suit your needs.

If Union(Target, myRange).Address = myRange.Address Then
' ColumnReset Macro
' Reset Column WIdths
'

'
Cells.Select
Selection.Columns.AutoFit

End If

End Sub

This will the column's width in the range selected, after entering data and
moving to the next cell using TAB or ENTER. You will need to alter the range
to suit your needs.

--
Add MS to your News Reader: news://msnews.microsoft.com
Rich/rerat
(RRR News) <message rule
<<Previous Text Snipped to Save Bandwidth When Appropriate


"DebC" wrote in message
...
Thank you; that is sort of what I thought, but hoped someone would be able
to
tell me differently! hehe Thank you so much.

"Bernard Liengme" wrote:

Double click the separator between the column and the one to the right
or
Select all the columns and use Format | Columns | AutoAdjust

I know of no way to make Excel automatically widen a column to hold any
amount of test entered into it.
best wishes

--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"DebC" wrote in message
...
I use Microsoft Office 2003. Is there a way to get columns to
automatically
adjust to fit the content of the cell?








All times are GMT +1. The time now is 10:35 PM.

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