Re: Counting Line Feeds Hard or Soft

From: Mark Hunter (anonymous_at_discussions.microsoft.com)
Date: 03/11/04


Date: Thu, 11 Mar 2004 07:56:24 -0800

Is there a way to count lines that are word wrapped to a
new line but do not have a hard return?

>-----Original Message-----
>Hi
>one way to count the number of lines using work***
function:
>=LEN(A1)-LEN(SUBSTITUTE(A1,CHAR(10),""))+1
>
>VBA solution:
>Function count_lines(rng As Range)
>If rng.Cells.count > 1 Then Exit Function
>count_lines = Len(rng.Value) - Len(Replace(rng.Value, Chr
(10), "")) + 1
>
>End Function
>
>
>--
>Regards
>Frank Kabel
>Frankfurt, Germany
>
>Mark Hunter wrote:
>> I am storing word wraped text in a cell and want to
conrol
>> the ultimate cell height based on the number of carriage
>> returns / line feeds in the text hard or soft returns.
Is
>> there a way to count them?
>>
>> In the alternative I want to control row height based on
>> specific cells in the row not all cells. Is there a way
to
>> do this?
>>
>> Thanks,
>
>.
>