Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default AutoFit not working properly

I have a cell formatted to wrap. I put in a value that is two words,
"Column plan". The row height is 25.50 so enough room for 2 lines in
the cell. If I make the column very narrow and then either double
click it or call a macro with Selection.Columns.AutoFit it only goes
to 5.57 wide and loses the "n" in column to the second line:

Colum
n plan

How can I get this to automatically size properly to look like:

Column
plan

?

In other words I want to do an AutoFit that will be as wide as my
widest word.

Note I am using Excel 2003 but my users could have other versions.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default AutoFit not working properly

Use two rows for the header data.
-or-
Auto fit your columns then check that the width of each column is = a minimum width.

--
Jim Cone
Portland, Oregon USA
Compare/List/Remove/Find: http://tinyurl.com/XLCompanion

..
..
..

"zxcv"
wrote in message
I have a cell formatted to wrap. I put in a value that is two words,
"Column plan". The row height is 25.50 so enough room for 2 lines in
the cell. If I make the column very narrow and then either double
click it or call a macro with Selection.Columns.AutoFit it only goes
to 5.57 wide and loses the "n" in column to the second line:

Colum
n plan

How can I get this to automatically size properly to look like:
Column
plan
?

In other words I want to do an AutoFit that will be as wide as my
widest word.
Note I am using Excel 2003 but my users could have other versions.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default AutoFit not working properly

Could this be a zoom issue?

I've noticed that most fonts fail to scale correctly when zooming in
Excel. I think Excel's Autofit feature is designed to give best
results at 100%. If your sheet isn't already set to 100% try doing
that and then work from there.

If that is the problem but you still need things to look right at
various zoom levels then maybe you could write a routine that runs
Autofit and then adds a fixed amount to the column width to compensate
for this phenomenon - this would take some trial and error of course,
to determine what that fixed amount should be depending on the font
and font size used.

HTH Nick
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default AutoFit not working properly

I can't use two rows. This is part of a bigger issue. There could be
more than 2 words too.

The minimum width try doesn't address the issue either and also is not
foolproof. I want this to scale properly, not have an arbitrarily big
cell. I don't want to waste space.

On Aug 3, 7:36*pm, "Jim Cone" wrote:
Use two rows for the header data.
-or-
Auto fit your columns then check that the width of each column is = a minimum width.

--
Jim Cone
Portland, Oregon *USA
Compare/List/Remove/Find: *http://tinyurl.com/XLCompanion

.
.
.

"zxcv"
wrote in message
I have a cell formatted to wrap. *I put in a value that is two words,
"Column plan". *The row height is 25.50 so enough room for 2 lines in
the cell. *If I make the column very narrow and then either double
click it or call a macro with Selection.Columns.AutoFit it only goes
to 5.57 wide and loses the "n" in column to the second line:

Colum
n plan

How can I get this to automatically size properly to look like:
Column
plan
?

In other words I want to do an AutoFit that will be as wide as my
widest word.
Note I am using Excel 2003 but my users could have other versions.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default AutoFit not working properly

On Aug 4, 7:12*am, Nick H wrote:
Could this be a zoom issue?

I've noticed that most fonts fail to scale correctly when zooming in
Excel. I think Excel's Autofit feature is designed to give best
results at 100%. If your sheet isn't already set to 100% try doing
that and then work from there.

If that is the problem but you still need things to look right at
various zoom levels then maybe you could write a routine that runs
Autofit and then adds a fixed amount to the column width to compensate
for this phenomenon - this would take some trial and error of course,
to determine what that fixed amount should be depending on the font
and font size used.

HTH *Nick


Yes. Zoom is set to 100%. Ironically if I zoom to 50% then it
AutoFits correctly but I need to stay at 100%. Yes I could add some
amount to the width that would work most of the time but I want to get
this to work properly without wasted space.


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default AutoFit not working properly


Set all columns to a width wider than the maximum and then do the autofit.
--
Jim Cone
Portland, Oregon USA
http://tinyurl.com/ExtrasXL

..
..
..

"zxcv"
wrote in message
I can't use two rows. This is part of a bigger issue. There could be
more than 2 words too.

The minimum width try doesn't address the issue either and also is not
foolproof. I want this to scale properly, not have an arbitrarily big
cell. I don't want to waste space.

On Aug 3, 7:36 pm, "Jim Cone" wrote:
Use two rows for the header data.
-or-
Auto fit your columns then check that the width of each column is = a minimum width.

--
Jim Cone
Portland, Oregon USA
Compare/List/Remove/Find: http://tinyurl.com/XLCompanion

.
.
.

"zxcv"
wrote in message
I have a cell formatted to wrap. I put in a value that is two words,
"Column plan". The row height is 25.50 so enough room for 2 lines in
the cell. If I make the column very narrow and then either double
click it or call a macro with Selection.Columns.AutoFit it only goes
to 5.57 wide and loses the "n" in column to the second line:

Colum
n plan

How can I get this to automatically size properly to look like:
Column
plan
?

In other words I want to do an AutoFit that will be as wide as my
widest word.
Note I am using Excel 2003 but my users could have other versions.


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default AutoFit not working properly

That will eliminate the wrap issue but it will make my columns too
wide. I want them to be only as wide as the widest word.

On Aug 4, 9:39*am, "Jim Cone" wrote:
Set all columns to a width wider than the maximum and then do the autofit..
--
Jim Cone
Portland, Oregon *USAhttp://tinyurl.com/ExtrasXL

.
.
.

"zxcv"
wrote in message
I can't use two rows. *This is part of a bigger issue. *There could be
more than 2 words too.

The minimum width try doesn't address the issue either and also is not
foolproof. *I want this to scale properly, not have an arbitrarily big
cell. *I don't want to waste space.

On Aug 3, 7:36 pm, "Jim Cone" wrote:

Use two rows for the header data.
-or-
Auto fit your columns then check that the width of each column is = a minimum width.


--
Jim Cone
Portland, Oregon USA
Compare/List/Remove/Find:http://tinyurl.com/XLCompanion


.
.
.


"zxcv"
wrote in message
I have a cell formatted to wrap. I put in a value that is two words,
"Column plan". The row height is 25.50 so enough room for 2 lines in
the cell. If I make the column very narrow and then either double
click it or call a macro with Selection.Columns.AutoFit it only goes
to 5.57 wide and loses the "n" in column to the second line:


Colum
n plan


How can I get this to automatically size properly to look like:
Column
plan
?


In other words I want to do an AutoFit that will be as wide as my
widest word.
Note I am using Excel 2003 but my users could have other versions.


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default AutoFit not working properly


Yes. *Zoom is set to 100%. *Ironically if I zoom to 50% then it
AutoFits correctly but I need to stay at 100%. *Yes I could add some
amount to the width that would work most of the time but I want to get
this to work properly without wasted space.


In that case this is probably either a Font or printer driver problem.
You could try experimenting by changing both of these things to try
and get a 'fix'. The trouble is, getting it to look right on one
system doesn't necessarily mean it will look right on all I'm afraid.

Good luck, Nick.
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default AutoFit not working properly

Tested it with my Excel, got exactly the same result:

Colum
n plan

Easy solution use a line feed + wrap:

- manually: type "column", press alt + enter, type "plan"
- formula: ="Column" & CHAR(10) & "plan" (or if u want to refer to
cells: =A1 & CHAR(10) & B1)

Best wishes
Daniel
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Yes No box no working properly Miree Excel Programming 2 October 15th 08 08:14 AM
Autofit for row height is not working. Why? Leo Excel Discussion (Misc queries) 3 July 28th 08 06:43 PM
But not working properly Rao Ratan Singh Excel Discussion (Misc queries) 2 September 14th 06 08:45 AM
AutoFit not working in vb.net when creating a xls ljhopkins_LOST and Cant find My Way Excel Programming 3 July 28th 06 08:46 PM
format-row-autofit not working Redheads Rule Excel Worksheet Functions 2 July 23rd 05 03:38 AM


All times are GMT +1. The time now is 01:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"