title: Excel export ; using VBA, how to export cell as formatted rather than the raw cell value
body: <p><a href="http://support.microsoft.com/kb/291296/en-us?wa=wsignin1.0" rel="nofollow">This link</a> shows how to write a small program to surround the cell value in double-quotation marks for a CSV export.</p>
  
  <pre><code>' Write current cell's text to file with quotation marks.
           Print #FileNum, """" &amp; Selection.Cells(RowCount, _
              ColumnCount).Text &amp; """";
  </code></pre>
  
  <p>Is there a way to reference the cell's <em>formatted</em> value and write the formatted value out instead? </p>
  
  <p>For example, the raw data could be <code>8543</code> but the spreadsheet might have Zip Code formatting applied to the column, so the value is displayed as <code>08543</code>.</p>