![]() |
|
#1
|
||||
|
||||
![]()
You could use the following function to count the number of lines in a range
Code:
Function NumLines(Rng As Range) As LongPtr 'Graham Mayor - http://www.gmayor.com Const wdStatisticLines As LongPtr = 1 NumLines = Rng.ComputeStatistics(wdStatisticLines) lbl_Exit: Exit Function End Function Code:
Sub macro1() MsgBox NumLines(Selection.Paragraphs(1).Range) End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#2
|
|||
|
|||
![]()
Thanks gmayor, It works like charm.
|
![]() |
|