AutoFit

  • Thread starter Thread starter Howard Kaikow
  • Start date Start date
H

Howard Kaikow

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?
 
Howard,
Something to try...
Make the columns wider than the text, then do the autofit...
'--
Sub JustRight()
ActiveSheet.UsedRange.Columns.EntireColumn.ColumnWidth = 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"
<[email protected]>
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?
 
Jim Cone said:
Howard,
Something to try...
Make the columns wider than the text, then do the autofit...
'--
Sub JustRight()
ActiveSheet.UsedRange.Columns.EntireColumn.ColumnWidth = 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.EntireColumn.ColumnWidth = 700
 
I see the problem.

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


"Howard Kaikow"
<[email protected]>
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.EntireColumn.ColumnWidth = 700
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top