title: VBA escaping characters in formula
body: <p>I have a formula which hardcoded should look like this:</p>
  
  <pre><code>=SUMMEWENNS(Rawdata!K2:K3446;Rawdata!I2:I3446;"bezahlt";Rawdata!A2:A3446;"&gt;="&amp;DATWERT("18.03.2013 00:00");Rawdata!A2:A3446;"&lt;="&amp;DATWERT("24.03.2013 23:59"))
  </code></pre>
  
  <p>I want to add the formula via VBA into different cells and have come up with this string, but there is a syntax problem and I cannot find the error. It most likely has to do with the escaping of the characters espacially with the "DATWERT".</p>
  
  <pre><code>qq = Chr(34)
  Cells(5, fieldextsales).FormulaLocal = "=SUMMEWENNS(RawData!K2:K" &amp; _
                       maxnumrows &amp; ";Rawdata!I2:I" &amp; maxnumrows &amp; ";" &amp; qq &amp; _
                       "bezahlt" &amp; qq &amp; ";Rawdata!A2:A" &amp; maxnumrows &amp; ";" &amp; _
                       qq &amp; "&gt;= " &amp; DATWERT(weekstart &amp; " 00:00") * 1 &amp; qq &amp; _
                       ";RawData!A2:A" &amp; maxnumrows &amp; ";" &amp; qq &amp; "&lt;= " &amp; _
                       DATWERT(weekend &amp; " 23:59") * 1 &amp; qq &amp; ")"
  </code></pre>
  
  <p>Could anybody help me out? Hope I get the hang of it then.</p>
  
  <p>Thx</p>