Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default changing the row height to fit

Can anyone please tell me if there is a way to automatically arrange the
height of a row to be adjusted to the text.
I have a summary sheet that is manually altered based on the validation cell
that is chosen for each situation. This changes the text that goes into the
cell.
The cell where the validation goes are merged cells and the text is wrapped.
Is there a way to automatically set the row height, for the entire sheet if
possible, by writing a macro or some other routine?
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 70
Default changing the row height to fit

You don't need any crazy formula. Assuming that all of the text in the
worksheet is the same size, just select the whole thing and change the font
size. That should bump everything up to the right size. I do that with huge
worksheets, then I go through and make the headings bigger/bold them in each
section (if it's requested).

"Stephen Sandor" wrote:

Can anyone please tell me if there is a way to automatically arrange the
height of a row to be adjusted to the text.
I have a summary sheet that is manually altered based on the validation cell
that is chosen for each situation. This changes the text that goes into the
cell.
The cell where the validation goes are merged cells and the text is wrapped.
Is there a way to automatically set the row height, for the entire sheet if
possible, by writing a macro or some other routine?
Thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default changing the row height to fit

Stephen

Long audible sigh here.................

One more victim of "merged cells".

Wrap Text works fine on merged cells, but Autofit does not work.

You need VBA event code or a macro to do that.

Here is event code from Greg Wilson.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim NewRwHt As Single
Dim cWdth As Single, MrgeWdth As Single
Dim c As Range, cc As Range
Dim ma As Range

With Target
If .MergeCells And .WrapText Then
Set c = Target.Cells(1, 1)
cWdth = c.ColumnWidth
Set ma = c.MergeArea
For Each cc In ma.Cells
MrgeWdth = MrgeWdth + cc.ColumnWidth
Next
Application.ScreenUpdating = False
ma.MergeCells = False
c.ColumnWidth = MrgeWdth
c.EntireRow.AutoFit
NewRwHt = c.RowHeight
c.ColumnWidth = cWdth
ma.MergeCells = True
ma.RowHeight = NewRwHt
cWdth = 0: MrgeWdth = 0
Application.ScreenUpdating = True
End If
End With
End Sub

This is event code. Right-click on the sheet tab and "View Code".

Copy/paste the above into that sheet module.


Gord Dibben MS Excel MVP


On Tue, 20 Feb 2007 15:03:11 -0800, Stephen Sandor
wrote:

Can anyone please tell me if there is a way to automatically arrange the
height of a row to be adjusted to the text.
I have a summary sheet that is manually altered based on the validation cell
that is chosen for each situation. This changes the text that goes into the
cell.
The cell where the validation goes are merged cells and the text is wrapped.
Is there a way to automatically set the row height, for the entire sheet if
possible, by writing a macro or some other routine?
Thanks


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
Changing the height of a row is very slow [email protected] Excel Discussion (Misc queries) 0 June 21st 06 02:06 PM
need to dbl row height without changing height of cell next to it Excel-Illiterate New Users to Excel 1 May 16th 06 01:08 AM
Changing row height. P Excel Discussion (Misc queries) 2 April 26th 06 05:32 PM
How to Paste without changing row height sara Excel Discussion (Misc queries) 2 June 30th 05 07:01 PM
cell height changing when using autofill WSCI-Nathan Excel Discussion (Misc queries) 1 January 17th 05 11:26 PM


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