View Single Post
 
Old 09-20-2011, 10:51 PM
Catalin.B Catalin.B is offline Windows Vista Office 2007
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

insert in a column of your choice this formula:
=CEILING(18*LEN(A4)/110;18)
where A4 is the cell to evaluate, 110 is the desired number of characters in one row of the same cell and 18 is your desired default height...adjust as necessary...
copy this formula down to all rows in column, then use this macro to adjust
row height :
Code:
Sub Height()
Dim planWks As Worksheet
Dim nextRow As Long
   Set planWks = Worksheets("Plan")
Dim i As Integer

Application.ScreenUpdating = False

For i = 1 To 100
    If planWks.Range("U" & i).Value > 0 Then
        Rows(i & ":" & i).RowHeight = planWks.Range("U" & i).Value
    End If
Next i
Application.ScreenUpdating = True
End Sub
change sheet name , range to evaluate and column letter as needed...
In this macro, the column which has the necessary row height (calculated with the initial formula) is column "U"

Last edited by Catalin.B; 09-20-2011 at 11:56 PM.
Reply With Quote