title: Split text across multiple rows according to column width
body: <p>I have a report generator in Excel VBA, which works so far. It reads some input data and produces a formatted Excel sheet as result. The last column of this sheet is filled with some kind of free text.</p>
  <p>Now, sometimes the free text does not fit into the last column, it is just too wide. Since the row height of all rows of this report is fixed, I cannot set <code>range.WrapText=True</code> for this column (to let the text stay visible, one would have to increase the row height). A manual (non-VBA) solution is easy: split the text into several parts and spread it over different rows. For example:</p>
  <pre><code>A          | B               |C
  content    |This text is too wide for column B.
  here       |This text fits.  |
  is         |                 |
  fixed      |                 |
  </code></pre>
  <p>should be transformed into</p>
  <pre><code>A          | B               |C
  content    |This text is too |
  here       |wide for column  |
  is         |B.               |
  fixed      |This text fits.  |
  </code></pre>
  <p>I could easily code that if I would be able to determine the real text width (using a proportional font!) of the content in column B using VBA. <code>range.ColumnWidth</code> gives me the actual width of the column, but I have no idea how I determine the width of <strong>&quot;This text is too wide for column B.&quot;</strong> in VBA. Any suggestions?</p>
  <p>(I am currently using Excel 2002 / XP).</p>