title: Excel/VBA: How to paste SQL query with proper string formatting
body: <p>I've been writing some pretty long SQL queries in notepad and then pasting them into my VBA code as-is and then formatting the multi-line string correctly each line at a time. For example...</p>
  
  <p>In my text editor, the query looks like this.</p>
  
  <pre><code>SELECT 
        a,
        b,
        c,
        ...,
        n
  FROM
        table1,
        table2,
        ...,
        tableN
  WHERE
        etc
  </code></pre>
  
  <p>Then pasting this into the VBA editor and manually adding <strong>sqlStr = sqlStr &amp; " .... "</strong> to every line.</p>
  
  <pre><code>sqlStr = "               SELECT "
  sqlStr = sqlStr &amp; "          a,"
  sqlStr = sqlStr &amp; "          b,"
  sqlStr = sqlStr &amp; "          c,"
  sqlStr = sqlStr &amp; "          ...,"
  sqlStr = sqlStr &amp; "          n"
  sqlStr = sqlStr &amp; "      FROM"
  sqlStr = sqlStr &amp; "          table1,"
  sqlStr = sqlStr &amp; "          table2,"
  sqlStr = sqlStr &amp; "          ...,"
  sqlStr = sqlStr &amp; "          tableN"
  sqlStr = sqlStr &amp; "      WHERE"
  sqlStr = sqlStr &amp; "          etc"
  </code></pre>
  
  <p>Does anyone know of a tool that will let me automatically wrap the VBA string stuff around my query (instead of adding it manually)? I imagine there's a web site somewhere for that, but I can't find it. </p>
  
  <p>I could rig up something in Vi, but I can't guarantee that I'll be doing this on a computer that I'll have rights to install Vi on.</p>
  
  <p>Any help appreciated! Thanks.</p>