title: Export an excel file to txt with same formatting
body: <p>I have an excel file written in this way:</p>
  
  <pre><code>187712  201    37     0.18   
  2525    580    149    0.25   
  136829  137    43     0.31
  </code></pre>
  
  <p>I need to export this file with same spaces, same formatting in a txt file. How can i do it? I've tryied <code>Save As | Formatted Text (Space Delimited) (*.prn)</code> but not working because i have an issue on the last column. Is there a macro? Thanks.</p>
  
  <p>EDIT: i tryied a macro:</p>
  
  <pre><code>Sub TEST()
      Dim c As Range, r As Range
      Dim output As String
      For Each r In Range("A1:L504").Rows
          For Each c In r.Cells
              output = output &amp; " " &amp; c.Value
          Next c
          output = output &amp; vbNewLine
      Next r
      Open "D:\MyPath\text.txt" For Output As #1
      Print #1, output
      Close
  End Sub
  </code></pre>
  
  <p>but the result is</p>
  
  <pre><code>187712  201    37     0.18   
  2525 580  149    0.25   
  136829  137    43     0.31
  </code></pre>
  
  <p>These values are only an example because there are about 504 columns!! Anyway the problem is that if in the first column there is a value shorter then the others it lost the formatting like the second row as you can see.</p>