Re: Height of the text in cell by Helmut
Helmut
Sun Dec 03 05:39:26 CST 2006
Hi,
like this, but I wonder, whether it's a good idea,
to reduce font size until the text doesn't occupy
more then the given number of lines.
Sub Test733()
Dim LinesAllowed As Long
LinesAllowed = 2
selection.Cells(1).Range.Text = String(30, "m")
selection.Cells(1).Select
selection.End = selection.End - 1
With selection.Range
While .ComputeStatistics(wdStatisticLines) > LinesAllowed
.Font.Size = .Font.Size - 1
Wend
End With
End Sub
--
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"