I am using Excel VBA to generate an email in Outlook.
I would like to pass a variable value to the HTML code I am using to generate emails. The HTML code is lives in Sheet1!$A$1
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!
VBA
Sub foo()
Dim myCustomVariable as string
myCustomVariable = "John Smith"
End Sub
HTML in Sheet1!$A$1
<html>
<body>
<p>Hello "myCustomVariable "</p>
</body>
</html>