title: Excel VBA Export to txt file without Quotation marks
body: <p>I'm needing to export to a text file without " marks example</p>
  
  <p>exporting this </p>
  
  <p>Create bts; sitemask = "0110"; pcmlink = 40</p>
  
  <p>exports like this </p>
  
  <p>"Create bts; sitemask = ""0110""; pcmlink = 40" </p>
  
  <p>This code I found for doing this works and strips off the " marks</p>
  
  <pre><code>Sub Export()
  Dim r As Range, c As Range
  Dim sTemp As String
  
  Open "c:\MyOutput.txt" For Output As #1
  For Each r In Selection.Rows
      sTemp = ""
      For Each c In r.Cells
          sTemp = sTemp &amp; c.Text &amp; Chr(9)
      Next c
  
      'Get rid of trailing tabs
      While Right(sTemp, 1) = Chr(9)
          sTemp = Left(sTemp, Len(sTemp) - 1)
      Wend
      Print #1, sTemp
  Next r
  Close #1
  End Sub
  </code></pre>
  
  <p>This code works from selecting the cells running the code which exports the current selected cells, my question is this how can I modify this code to work on a predefined cell range eg A1 to A10 for exporting rather than the current selection?</p>
  
  <p>Also is there away to modify the file path to save in the same directory as the active excel sheet instead of having to put the full file path"C:\MyOutput.txt" instead "MyOutput.txt" (or something like that)?</p>
  
  <p>Many thanks </p>