#1   Report Post  
Posted to microsoft.public.excel.misc
Sal
 
Posts: n/a
Default Row Height to fit

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
Jim Rech
 
Posts: n/a
Default Row Height to fit

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
"Sal" 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


  #3   Report Post  
Posted to microsoft.public.excel.misc
Sal
 
Posts: n/a
Default Row Height to fit

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
--

"Jim Rech" wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.misc
Jim Rech
 
Posts: n/a
Default Row Height to fit

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 rules<g:

''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
"Sal" 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
| --
|
| "Jim Rech" wrote:
|
| 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


  #5   Report Post  
Posted to microsoft.public.excel.misc
Sal
 
Posts: n/a
Default Row Height to fit

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 answers


"Jim Rech" wrote:

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 rules<g:

''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
"Sal" 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
| --
|
| "Jim Rech" wrote:
|
| 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



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 - merged cells w/wrapped text auto row height doesn't work. Fred Excel Discussion (Misc queries) 0 October 21st 05 02:11 PM
formula for linear regression DBane Excel Worksheet Functions 14 September 1st 05 09:54 PM
Resizing row height to dynamically fit height of text box Jon Excel Discussion (Misc queries) 1 August 8th 05 01:37 PM
Row Height Dennis B. Excel Discussion (Misc queries) 2 April 18th 05 02:23 PM
Height Needs To Be Increased In Row Deb Setting up and Configuration of Excel 1 March 4th 05 06:50 PM


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