I have Excel 2003.
I have a worksheet with 11 columns. I need to adjust the column width of
each column so that all data will be shown. I know that I can do this
adjustment by double clicking on each column's border, but that means 11
double clicks; I would like to adjust all of the columns with a single
action. Is this possible?
Thank you.
Dave Peterson - 21 May 2007 01:11 GMT
Select all 11 columns first. Then they'all all react to that double click.
And you could throw caution to the wind and select all the cells and adjust all
of the non-empty columns at once!
> I have Excel 2003.
>
[quoted text clipped - 5 lines]
>
> Thank you.

Signature
Dave Peterson
jfg - 21 May 2007 02:01 GMT
Thanks, Dave.
> Select all 11 columns first. Then they'all all react to that double click.
>
[quoted text clipped - 10 lines]
> >
> > Thank you.
Gord Dibben - 21 May 2007 01:14 GMT
Select the 11 columns by dragging the mouse pointer across the headers.
Double-click on any column.
Gord Dibben MS Excel MVP
>I have Excel 2003.
>
[quoted text clipped - 5 lines]
>
>Thank you.
jfg - 21 May 2007 02:02 GMT
Thank you very much, Gord.
> Select the 11 columns by dragging the mouse pointer across the headers.
>
[quoted text clipped - 11 lines]
> >
> >Thank you.
AKphidelt - 21 May 2007 01:19 GMT
Alright, follow these instructions...
Go to
Tools--> Macro --> VBE (Visual Basic Editor)
Look to your left, you will see something called the Project Explorer. It
will have a tree setup that says VBAProject then whatever the name of your
workbook is.
Open up your workbook in this Project Explorer...
Double click on the Sheet that you want the auto fit.
A module should open up.
On top of that module you will see a drop down box with the word "general"
in it.
Change that to Worksheet.
When you change it this should show up.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
End Sub
If you see this copy and paste this code in between those two lines...
Columns("A:H").EntireColumn.AutoFit
Change, A or H to whatever columns you need changed. What A:H means is that
A,B,C,D,E,F,G,H has AutoFit in it.
Then whenever you do anything on that worksheet it will automatically
autofit the columns for you. LMK if this works.
> I have Excel 2003.
>
[quoted text clipped - 5 lines]
>
> Thank you.
AKphidelt - 21 May 2007 01:20 GMT
Oh yea, I forgot... if you are just doing this once you can just highlight
all 11 columns and double click on just one of them... and it will autofit
all 11. Lol, should of went with that one first.
> I have Excel 2003.
>
[quoted text clipped - 5 lines]
>
> Thank you.
jfg - 21 May 2007 02:21 GMT
Thank you, AKphidelt. I am doing the column change only once, so I will go
with the highlighting and double-clicking. However, I appreciate your
instructions regarding the Project Explorer. It represents a permanent
solution, and I am going to learn it.
> Oh yea, I forgot... if you are just doing this once you can just highlight
> all 11 columns and double click on just one of them... and it will autofit
[quoted text clipped - 9 lines]
> >
> > Thank you.
glenlee - 21 May 2007 02:32 GMT
Another way.....highlight the entire worksheet, then click
Format--Column--AutoFit
>I have Excel 2003.
>
[quoted text clipped - 5 lines]
>
>Thank you.
jfg - 23 May 2007 01:02 GMT
Thank you, Glenlee. I was always wondering what that "AutoFit" was about.
> Another way.....highlight the entire worksheet, then click
> Format--Column--AutoFit
[quoted text clipped - 8 lines]
> >
> >Thank you.