ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Automatically adjusting columns (https://www.excelbanter.com/excel-discussion-misc-queries/143440-automatically-adjusting-columns.html)

jfg

Automatically adjusting columns
 
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

Automatically adjusting columns
 
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!

jfg wrote:

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

Gord Dibben

Automatically adjusting columns
 
Select the 11 columns by dragging the mouse pointer across the headers.

Double-click on any column.


Gord Dibben MS Excel MVP

On Sun, 20 May 2007 17:05:00 -0700, jfg wrote:

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.



AKphidelt

Automatically adjusting columns
 
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.

"jfg" wrote:

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.


AKphidelt

Automatically adjusting columns
 
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.

"jfg" wrote:

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.


jfg

Automatically adjusting columns
 
Thanks, Dave.

"Dave Peterson" wrote:

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!

jfg wrote:

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


jfg

Automatically adjusting columns
 
Thank you very much, Gord.

"Gord Dibben" wrote:

Select the 11 columns by dragging the mouse pointer across the headers.

Double-click on any column.


Gord Dibben MS Excel MVP

On Sun, 20 May 2007 17:05:00 -0700, jfg wrote:

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.




jfg

Automatically adjusting columns
 
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.

"AKphidelt" wrote:

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.

"jfg" wrote:

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.


glenlee

Automatically adjusting columns
 
Another way.....highlight the entire worksheet, then click
Format--Column--AutoFit



On Sun, 20 May 2007 17:05:00 -0700, ?B?amZn?=
wrote:

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.



jfg

Automatically adjusting columns
 
Thank you, Glenlee. I was always wondering what that "AutoFit" was about.


"glenlee" wrote:

Another way.....highlight the entire worksheet, then click
Format--Column--AutoFit



On Sun, 20 May 2007 17:05:00 -0700, ?B?amZn?=
wrote:

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.





All times are GMT +1. The time now is 08:17 PM.

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