ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Columns.Autofit not doing what I want (https://www.excelbanter.com/excel-programming/314651-columns-autofit-not-doing-what-i-want.html)

Ed

Columns.Autofit not doing what I want
 
. . . and maybe Excel doesn't behave like I want, but if anyone can help
me, I'd appreciate it. What I want is the column to fit a logical word or
group. But I have A7X-00090, and AutoFit makes it fit the A7X-, squeezing
the 00090 to another line. Similarly, a header is Identification, but it
breaks between the last t and i because that's the longest whole word in the
column under that header. Is there any way to tell Excel what I want
besides setting individual column widths by size number?

Ed



Jim Rech

Columns.Autofit not doing what I want
 
It seems as if the problem cells are being ignored for Autofit purposes. Do
they have Wrap Text selected under Format, Cells, Alignment?

--
Jim Rech
Excel MVP
"Ed" wrote in message
...
| . . . and maybe Excel doesn't behave like I want, but if anyone can help
| me, I'd appreciate it. What I want is the column to fit a logical word or
| group. But I have A7X-00090, and AutoFit makes it fit the A7X-, squeezing
| the 00090 to another line. Similarly, a header is Identification, but it
| breaks between the last t and i because that's the longest whole word in
the
| column under that header. Is there any way to tell Excel what I want
| besides setting individual column widths by size number?
|
| Ed
|
|



Ed

Columns.Autofit not doing what I want
 
Jim, that was it! Now the columns are wide enough. BUT . . .
rngWork.Columns.AutoFit = True throws an error - "Object required", but the
columns are AutoFitted?!?

Ed

"Jim Rech" wrote in message
...
It seems as if the problem cells are being ignored for Autofit purposes.

Do
they have Wrap Text selected under Format, Cells, Alignment?

--
Jim Rech
Excel MVP
"Ed" wrote in message
...
| . . . and maybe Excel doesn't behave like I want, but if anyone can help
| me, I'd appreciate it. What I want is the column to fit a logical word

or
| group. But I have A7X-00090, and AutoFit makes it fit the A7X-,

squeezing
| the 00090 to another line. Similarly, a header is Identification, but

it
| breaks between the last t and i because that's the longest whole word in
the
| column under that header. Is there any way to tell Excel what I want
| besides setting individual column widths by size number?
|
| Ed
|
|






All times are GMT +1. The time now is 04:30 AM.

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