close

Hi All,

When I first start a worksheet and set word wrap to ON in a cell, the row
height will grow to suit the contents of the cell. If I later set the row ht,
the contents 'could' actually not be visible.

How can I tell the row height to grow with the contents?
--
Just trying to get some answers

Let me answer the question I think you're asking..

In a new worksheet all rows are set to 'auto-fit' their row heights. That
means if you turn on word wrap or if you increase the font size of a cell,
the row's height will automatically increase to accommodate it. However, if
you manually set a row's height, it no longer will auto-fit. Excel assumes
that when you manually set a row height it's because that is the height you
want, so it maintains it.

To get back to autofit use Format, Row, AutoFit. A shortcut is to
double-click the separator between the row numbers in the left border.

--
Jim
quot;Salquot; gt; wrote in message
...
| Hi All,
|
| When I first start a worksheet and set word wrap to ON in a cell, the row
| height will grow to suit the contents of the cell. If I later set the row
ht,
| the contents 'could' actually not be visible.
|
| How can I tell the row height to grow with the contents?
| --
| Just trying to get some answers
Hi Jim,

....and thanks. You were thinking the right question. And your answer is
correct for all my rows except the ones with merged cells and they are really
the problem.

I have a couple rows with merged cells that increase in content every once
in a while and I would like the cell's ht to increase as well. Is it possible
that I'm destined to manually (yuch) adjust them each time?

Oh please say it isn't so.

Sal
--

quot;Jim Rechquot; wrote:

gt; Let me answer the question I think you're asking..
gt;
gt; In a new worksheet all rows are set to 'auto-fit' their row heights. That
gt; means if you turn on word wrap or if you increase the font size of a cell,
gt; the row's height will automatically increase to accommodate it. However, if
gt; you manually set a row's height, it no longer will auto-fit. Excel assumes
gt; that when you manually set a row height it's because that is the height you
gt; want, so it maintains it.
gt;
gt; To get back to autofit use Format, Row, AutoFit. A shortcut is to
gt; double-click the separator between the row numbers in the left border.
gt;
gt; --
gt; Jim

You should have mentioned merged cells initially. Yes, merged cells are
totally ignored for purposes of autofitting row heights.

If you're familiar with macros this might save you a little hassle. Be sure
to read all the ruleslt;ggt;:

''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 gt; PossNewRowHeight, _
CurrentRowHeight, PossNewRowHeight)
End If
End With
End If
End Sub--
Jim
quot;Salquot; gt; wrote in message
...
| Hi Jim,
|
| ...and thanks. You were thinking the right question. And your answer is
| correct for all my rows except the ones with merged cells and they are
really
| the problem.
|
| I have a couple rows with merged cells that increase in content every once
| in a while and I would like the cell's ht to increase as well. Is it
possible
| that I'm destined to manually (yuch) adjust them each time?
|
| Oh please say it isn't so.
|
| Sal
| --
|
| quot;Jim Rechquot; wrote:
|
| gt; Let me answer the question I think you're asking..
| gt;
| gt; In a new worksheet all rows are set to 'auto-fit' their row heights.
That
| gt; means if you turn on word wrap or if you increase the font size of a
cell,
| gt; the row's height will automatically increase to accommodate it.
However, if
| gt; you manually set a row's height, it no longer will auto-fit. Excel
assumes
| gt; that when you manually set a row height it's because that is the height
you
| gt; want, so it maintains it.
| gt;
| gt; To get back to autofit use Format, Row, AutoFit. A shortcut is to
| gt; double-click the separator between the row numbers in the left border.
| gt;
| gt; --
| gt; Jim
Wow Jim, this is fantastic. Thanks for the free code. I will use it although
the contents do indeed decrease as well as increase so for this instance it
will not work.

Thanks again.
--
Just trying to get some answersquot;Jim Rechquot; wrote:

gt; You should have mentioned merged cells initially. Yes, merged cells are
gt; totally ignored for purposes of autofitting row heights.
gt;
gt; If you're familiar with macros this might save you a little hassle. Be sure
gt; to read all the ruleslt;ggt;:
gt;
gt; ''Simulates row height autofit for a merged cell if the active cell..
gt; '' is merged.
gt; '' has Wrap Text set.
gt; '' includes only 1 row.
gt; ''Unlike real autosizing the macro only increases row height
gt; '' (if needed). It does not reduce row height (because another
gt; '' merged cell on the same row may needed a greater height
gt; '' than the active cell).
gt; Sub AutoFitMergedCellRowHeight()
gt; Dim CurrentRowHeight As Single, MergedCellRgWidth As Single
gt; Dim CurrCell As Range
gt; Dim ActiveCellWidth As Single, PossNewRowHeight As Single
gt; If ActiveCell.MergeCells Then
gt; With ActiveCell.MergeArea
gt; If .Rows.Count = 1 And .Cells(1).WrapText = True Then
gt; Application.ScreenUpdating = False
gt; CurrentRowHeight = .RowHeight
gt; ActiveCellWidth = ActiveCell.ColumnWidth
gt; For Each CurrCell In Selection
gt; MergedCellRgWidth = CurrCell.ColumnWidth
gt; MergedCellRgWidth
gt; Next
gt; .MergeCells = False
gt; .Cells(1).ColumnWidth = MergedCellRgWidth
gt; .EntireRow.AutoFit
gt; PossNewRowHeight = .RowHeight
gt; .Cells(1).ColumnWidth = ActiveCellWidth
gt; .MergeCells = True
gt; .RowHeight = IIf(CurrentRowHeight gt; PossNewRowHeight, _
gt; CurrentRowHeight, PossNewRowHeight)
gt; End If
gt; End With
gt; End If
gt; End Sub
gt;
gt;
gt; --
gt; Jim
gt; quot;Salquot; gt; wrote in message
gt; ...
gt; | Hi Jim,
gt; |
gt; | ...and thanks. You were thinking the right question. And your answer is
gt; | correct for all my rows except the ones with merged cells and they are
gt; really
gt; | the problem.
gt; |
gt; | I have a couple rows with merged cells that increase in content every once
gt; | in a while and I would like the cell's ht to increase as well. Is it
gt; possible
gt; | that I'm destined to manually (yuch) adjust them each time?
gt; |
gt; | Oh please say it isn't so.
gt; |
gt; | Sal
gt; | --
gt; |
gt; | quot;Jim Rechquot; wrote:
gt; |
gt; | gt; Let me answer the question I think you're asking..
gt; | gt;
gt; | gt; In a new worksheet all rows are set to 'auto-fit' their row heights.
gt; That
gt; | gt; means if you turn on word wrap or if you increase the font size of a
gt; cell,
gt; | gt; the row's height will automatically increase to accommodate it.
gt; However, if
gt; | gt; you manually set a row's height, it no longer will auto-fit. Excel
gt; assumes
gt; | gt; that when you manually set a row height it's because that is the height
gt; you
gt; | gt; want, so it maintains it.
gt; | gt;
gt; | gt; To get back to autofit use Format, Row, AutoFit. A shortcut is to
gt; | gt; double-click the separator between the row numbers in the left border.
gt; | gt;
gt; | gt; --
gt; | gt; Jim
gt;
gt;
gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()