title: vba string assignment. WHy am I getting 1004 run time error?
body: <p>On the below line in my code I am getting a 1004 run time error: Application-defined or object-defined error. I think it might be a problem on the right side of the statement. However, I've changed the way it is written a few times to no avail. As you can see I have tried inserting many character codes. What I ultimately want inserted into cell B1, where B1 is the active cell is ="'"&amp;A1&amp;"',"       with spaces for clarity:  = " ' " &amp;A1&amp; " ' , "</p>
  
  <p>This is supposed to reference cell A1, take that value and put it inside single quotes, with a comma at the end. This is so it is formatted for an SQL statement.</p>
  
  <p>Any help will be appreciated. I know this is a common error, but the error message is not helping.</p>
  
  <pre><code>ActiveCell.Formula = Chr(61) &amp; "'" &amp; Chr(34) &amp; Chr(38) &amp; "A1" &amp; Chr(38) &amp; Chr(34) &amp; "',"
  </code></pre>