Counting lines

C

Conan Kelly

Hello all,

Is there a way to count how many lines are in the current selection?

I've been looking for it but haven't found anything. I've found the Count property of Paragraphs, Words, & Sentences; but no Lines
property.

If not possible to count lines, how about counting the number of paragraph marks in the current selection?
 
G

Greg Maxey

Sub Scratchmacro()
Dim oRng As Range
Set oRng = Selection.Range
MsgBox oRng.ComputeStatistics(wdStatisticLines)
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top