title: Count number of lines in a wrapped cell through vba
body: <p>How can I count the number of lines in a wrapped cell through vba code?</p>
  
  <pre><code>With Cells(1, 1)
      .WrapText = False
      height1 = .height
      .WrapText = True
      height2 = .height
  End With 
  MsgBox height2 / height1 &amp; " Lines"
  </code></pre>
  
  <p>This code will not work since I have set row height to a fixed one (only one line is visible).</p>
  
  <p>Also in my text, no line breaks since the data is entered through VBA code.</p>
  
  <p>Thanks in advance.</p>