title: Predict text wrapping in cell
body: <p>The problem:
  I use VBA to populate MS Excel 2000 cells with text. The column has a fixed width (should not be changed due to layout) and the wordwrap property is set to true so the text wraps over multiple lines if wider than the column.
  Unfortunately, the row-height do not always get updated accordingly. I need a way to predict if the text wraps over multiple lines so I can "manually" adjust the height.</p>
  
  <p>I want to do something like this:</p>
  
  <pre><code>range("A1").value = longText  
  range("A1").EntireRow.RowHeight = 14 * GetNrOfLines(range("A1"))  
  </code></pre>
  
  <p>How do I write the function GetNrOfLines?</p>
  
  <p>I can't rely on number of characters since the font is not mono-space. Sometimes the cells I'm writing to are merged with other cells so Autofit doesn't work.
  Please remember that I'm working in Excel 2000.
  Suggestions?</p>