title: Long, one column list in Excel, convert For SQL where in statement
body: <p>I have an arbitrarily long one column list in Excel.  I need to put this list in the where statement of SQL server.<br>
  There is a manual way of doing this: list starts at <code>A1 until A40</code>. Use <code>B1="'"&amp;A1&amp;"',"</code>.  This encloses each element of the list in <code>'',</code>.  Next <code>C1=B1 and C2=C1&amp;B2..C40=C39&amp;B40</code><br>
  The final element in the list will have <code>,</code> manually removed.</p>
  
  <p><a href="https://i.stack.imgur.com/hEvC2.png" rel="nofollow noreferrer">sample excel</a></p>
  
  <p><code>Where recipID in ('1865','1733','1990')</code></p>
  
  <p>Everything is good if I do this once or twice a year.  But its becoming increasingly routine. I could record-a-macro and build off that.  However I'm more looking for a 2 in 1 macro that not only preps the data for SQL, but also copies to the clipboard - so that the only actions needed is to select the list, run macro, and paste into SQL.  </p>