#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default AutoFit

The problem described in http://support.microsoft.com/kb/214394 seems to
prevent AutoFit from working as expected.

Is there a progammatic solution?

I tried

With wst.Columns.EntireColumn
.Font.Name = "Courier New"
.AutoFit
End With

Still required manual adjustment.

One approach, too ugly to use, might be to search for the largest cell in
each column and adjust the column size.
Is there a better way?

--
http://www.standards.com/; See Howard Kaikow's web site.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default AutoFit


Howard,
Something to try...
Make the columns wider than the text, then do the autofit...
'--
Sub JustRight()
ActiveSheet.UsedRange.Columns.EntireColumn.ColumnW idth = 150
ActiveSheet.UsedRange.Columns.EntireColumn.AutoFit
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Howard Kaikow"

wrote in message
The problem described in http://support.microsoft.com/kb/214394 seems to
prevent AutoFit from working as expected.
Is there a progammatic solution?
I tried
With wst.Columns.EntireColumn
.Font.Name = "Courier New"
.AutoFit
End With
Still required manual adjustment.
One approach, too ugly to use, might be to search for the largest cell in
each column and adjust the column size.
Is there a better way?
--
http://www.standards.com/; See Howard Kaikow's web site.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default AutoFit

"Jim Cone" wrote in message
...

Howard,
Something to try...
Make the columns wider than the text, then do the autofit...
'--
Sub JustRight()
ActiveSheet.UsedRange.Columns.EntireColumn.ColumnW idth = 150
ActiveSheet.UsedRange.Columns.EntireColumn.AutoFit
End Sub


thanx.

I would expect that would result in the same issue as raised in te KB
article, i.e., the difference 'tween sceen and print fonts.

In any case, I got an unable to set ColumnWidth of Range upject using vrious
forms, including:

ExcelWbk.ActiveSheet.UsedRange.Columns.EntireColum n.ColumnWidth = 700


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default AutoFit

I see the problem.

The max size of a column is 255, so I cannot make the column large enough.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default AutoFit


Maximum column width is 255.
Jim Cone


"Howard Kaikow"

wrote in message

thanx.
I would expect that would result in the same issue as raised in te KB
article, i.e., the difference 'tween sceen and print fonts.
In any case, I got an unable to set ColumnWidth of Range upject using vrious
forms, including:
ExcelWbk.ActiveSheet.UsedRange.Columns.EntireColum n.ColumnWidth = 700


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
Autofit Maxine Excel Discussion (Misc queries) 2 April 22nd 10 12:50 PM
Autofit (Columns.EntireColumn.AutoFit) does not work Michiel via OfficeKB.com Excel Discussion (Misc queries) 3 February 10th 09 05:29 PM
Autofit Jentan Excel Programming 1 November 2nd 06 08:12 AM
autofit Elena Excel Programming 3 May 22nd 06 05:48 PM
autofit does not autofit rreneerob Excel Discussion (Misc queries) 1 October 17th 05 05:55 PM


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

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

About Us

"It's about Microsoft Excel"