#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Autofit

Just to add. If you want to know why you have the problem as you set it up:

From the immediate window:

? activecell.Entirerow.autofit
True

so it autofits the row properly and returns true which you then set to the
row height.

RowHeight is looking for a long so looking at the conversion:

? clng(activecell.Entirerow.autofit)
-1

Not sure why it doesn't just hide the row, but perhaps it discards the
negative sign.

--
Regards,
Tom Ogilvy



"Tom Ogilvy" wrote in message
...
Think you mistaken Kevin. The answer you got was:

Sub CCCC()
With Worksheets("Sheet1").Rows(39)
.AutoFit
End With
End Sub


I don't see any .RowHeight in that answer anywhere.

--
Regards,
Tom Ogilvy

"kevin" wrote in message
...
Earlier I posted a question to this forum concerning
setting a row to Autofit. The answer I got was to use the
following code:

With Worksheets("sheet1").Rows(39)
.RowHeight = .AutoFit
End With

When this executes, the row hight is reduced to 1 pt. Why?

Any help would be appreciated!

Kevin





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 does not autofit rreneerob Excel Discussion (Misc queries) 1 October 17th 05 05:55 PM
AutoFit TanahAirShah Excel Programming 1 January 16th 04 10:04 PM
row autofit Robin Hammond Excel Programming 0 September 6th 03 02:33 AM


All times are GMT +1. The time now is 11:07 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"