Hi folks.
I need to write a macros that reduces size of text in table when it
begin to resize in case of long string of text inserted ?

Re: Height of the text in cell by Jezebel

Jezebel
Sun Dec 03 04:58:02 CST 2006

Yes?

<Phelicks@gmail.com> wrote in message
news:1165137057.215963.241290@j72g2000cwa.googlegroups.com...
> Hi folks.
> I need to write a macros that reduces size of text in table when it
> begin to resize in case of long string of text inserted ?
>



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"

Re: Height of the text in cell by Phelicks

Phelicks
Sun Dec 03 08:00:03 CST 2006

Thats a good idea !!!

Helmut Weber wrote:
> 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"