title: How to pass a variable in VBA to HTML code?
body: <p>I am using Excel VBA to generate an email in Outlook.</p>
  
  <p>I would like to pass a variable value to the HTML code I am using to generate emails. The HTML code is lives in <code>Sheet1!$A$1</code></p>
  
  <p>How can I pass a variable value from a subroutine to the HTML code? I don't want to write out my HTML code in a module as writing it in VBA is painful! </p>
  
  <p>VBA</p>
  
  <pre><code>Sub foo()
  Dim myCustomVariable as string
  myCustomVariable = "John Smith"
  End Sub
  </code></pre>
  
  <p>HTML in <code>Sheet1!$A$1</code></p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;p&gt;Hello "myCustomVariable "&lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>