Count number of lines of text in a range/value.

J

Jacob

To start,
1) Add a form w/ a textbox to your VBA project.
2) Set the textbox's AUTOSIZE property to False.
3) Set the textbox's MULTILINE property to False.

In your code...
4) Call on the Form's SHOW method (modal or modeless is irrelevant).
5) Set the textbox's TEXT property to the (trimmed) value you are
working with.
6) Set the textbox's AUTOSIZE property to True.
7) Set the textbox's MULTILINE property to True.
8) Save/get the textbox's LINECOUNT property.
9) Call on the form's HIDE method.
 
J

Jacob

btw, I assume no responsibility for the code. Use it at your own risk.
Please let me know if there is a better way to do this (ie w/o a form
and tbox).
 
Top