title: VBA What's wrong with this MsgBox Syntax
body: <p>When I try to compile I'm given this error:</p>
  <blockquote>
  <p>Compile error:</p>
  <p>Syntax error</p>
  </blockquote>
  <p>Here is the code:</p>
  <pre><code>Public Sub ErrorHandler()
  '   The code is cleaned up by using ErrorHandler as a function because it has to be written out fewer times, and makes changing ErrorHandler easier
  
  MsgBox(&quot;Error detected&quot; &amp; vbNewLine &amp; vbNewLine &amp; &quot;Error &quot; &amp; Err.Number, vbCritical, &quot;Error Handler: Error &quot; &amp; Err.Number)
  
  End Sub
  </code></pre>