#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Excel 2007 Autofit

I am using Excel 2007. Im working on a spreadsheet where I would like to
have a row (which has been merged and wrapped) height adjust automatically as
the writing wraps around. Ive gone to the Home Tab, to the Cell Block, to
Format, to Autofit Row Height, and it doesnt work. Ive tried clicking
twice on the line item line to get it to automatically enlarge row, but that
didnt work either. Any suggestions?
Thanks
Sharon

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,355
Default Excel 2007 Autofit

IIRC, it does the same thing in 2003.

Barb Reinhardt


"SJHMCSE" wrote:

I am using Excel 2007. Im working on a spreadsheet where I would like to
have a row (which has been merged and wrapped) height adjust automatically as
the writing wraps around. Ive gone to the Home Tab, to the Cell Block, to
Format, to Autofit Row Height, and it doesnt work. Ive tried clicking
twice on the line item line to get it to automatically enlarge row, but that
didnt work either. Any suggestions?
Thanks
Sharon

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 533
Default Excel 2007 Autofit

Autofit does not work with merged cells. It the merged cell has only one
row you might find this macro helpful.

''Simulates row height autofit for a merged cell if the active cell..
'' is merged.
'' has Wrap Text set.
'' includes only 1 row.
''Unlike real autosizing the macro only increases row height
'' (if needed). It does not reduce row height (because another
'' merged cell on the same row may needed a greater height
'' than the active cell).
Sub AutoFitMergedCellRowHeight()
Dim CurrentRowHeight As Single, MergedCellRgWidth As Single
Dim CurrCell As Range
Dim ActiveCellWidth As Single, PossNewRowHeight As Single
If ActiveCell.MergeCells Then
With ActiveCell.MergeArea
If .Rows.Count = 1 And .Cells(1).WrapText = True Then
Application.ScreenUpdating = False
CurrentRowHeight = .RowHeight
ActiveCellWidth = ActiveCell.ColumnWidth
For Each CurrCell In Selection
MergedCellRgWidth = CurrCell.ColumnWidth +
MergedCellRgWidth
Next
.MergeCells = False
.Cells(1).ColumnWidth = MergedCellRgWidth
.EntireRow.AutoFit
PossNewRowHeight = .RowHeight
.Cells(1).ColumnWidth = ActiveCellWidth
.MergeCells = True
.RowHeight = IIf(CurrentRowHeight PossNewRowHeight, _
CurrentRowHeight, PossNewRowHeight)
End If
End With
End If
End Sub


--
Jim
"SJHMCSE" wrote in message
...
I am using Excel 2007. I'm working on a spreadsheet where I would like to
have a row (which has been merged and wrapped) height adjust automatically
as
the writing wraps around. I've gone to the Home Tab, to the Cell Block,
to
Format, to Autofit Row Height, and it doesn't work. I've tried clicking
twice on the line item line to get it to automatically enlarge row, but
that
didn't work either. Any suggestions?
Thanks
Sharon



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,344
Default Excel 2007 Autofit

Hi,

This is not a bug, this is how Microsoft intentionally coded it. As Jim
pointed out you can't best fit wrapped cells. However, there is a caveat to
that - if the cell is wider or taller than necessary and you apply best fit
it will size the cell down.

Why is it programmed this way? Suppose that you wrapped 20 lines of text
which was 1200 characters long and then you double-clicked that column to do
best fit, the column would become 1200 characters wide - actually the maximum
column width is 255, but you get the idea.


--
Thanks,
Shane Devenshire


"SJHMCSE" wrote:

I am using Excel 2007. Im working on a spreadsheet where I would like to
have a row (which has been merged and wrapped) height adjust automatically as
the writing wraps around. Ive gone to the Home Tab, to the Cell Block, to
Format, to Autofit Row Height, and it doesnt work. Ive tried clicking
twice on the line item line to get it to automatically enlarge row, but that
didnt work either. Any suggestions?
Thanks
Sharon

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Excel 2007 Autofit

I see. Thank you so much, especially for the explanation.

"ShaneDevenshire" wrote:

Hi,

This is not a bug, this is how Microsoft intentionally coded it. As Jim
pointed out you can't best fit wrapped cells. However, there is a caveat to
that - if the cell is wider or taller than necessary and you apply best fit
it will size the cell down.

Why is it programmed this way? Suppose that you wrapped 20 lines of text
which was 1200 characters long and then you double-clicked that column to do
best fit, the column would become 1200 characters wide - actually the maximum
column width is 255, but you get the idea.


--
Thanks,
Shane Devenshire


"SJHMCSE" wrote:

I am using Excel 2007. Im working on a spreadsheet where I would like to
have a row (which has been merged and wrapped) height adjust automatically as
the writing wraps around. Ive gone to the Home Tab, to the Cell Block, to
Format, to Autofit Row Height, and it doesnt work. Ive tried clicking
twice on the line item line to get it to automatically enlarge row, but that
didnt work either. Any suggestions?
Thanks
Sharon

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
Excel 2007 Autofit row/column height CentralBased Excel Discussion (Misc queries) 4 October 6th 08 09:49 PM
Excel 2003 autofit ignored by some rows Paul Excel Discussion (Misc queries) 3 September 10th 08 01:24 PM
### in print preview while using autofit in Excel 2007. TomD Excel Discussion (Misc queries) 0 June 23rd 08 11:34 PM
How do I modify the autofit function in Excel? NadineWoj Excel Discussion (Misc queries) 2 February 22nd 06 10:25 PM
What's the shortcut key for autofit in MS Excel Harsha Excel Discussion (Misc queries) 1 September 15th 05 02:13 PM


All times are GMT +1. The time now is 04:52 PM.

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"