title: Manipulate text string with many "s in order to paste function on rows in VBA
body: <p>I'm trying to create a loop which pastes a formula based on an index value but I'm running into a problem since the string has many "s. I want to paste the formula in this way since I'm pulling data from an API and I can't access the API data in a loop. </p>
  
  <p>I made the following code for a formula </p>
  
  <pre><code>Dim LastRow As Long
  Dim r As Long
  
  r = 10
  StartRow = 3
  LastRow = Range("I" &amp; StartRow).End(xlDown).Row
  
  For i = StartRow To LastRow
  Range("B" &amp; r).Value = "=BCurveStrip(I" &amp; i &amp; ")"
  
  r = r + 1
  Next i
  </code></pre>
  
  <p>This returns in cell "B" </p>
  
  <pre><code>          "B"
  10    =BCurveStrip(I3)
  11    =BCurveStrip(I4)
  12    =BCurveStrip(I5)
  13    =BCurveStrip(I6)
  </code></pre>
  
  <p>I want to do  the same for a formula which is a bit more complicated and looks like this:</p>
  
  <pre><code>=BCurveFwd(B13;"startdate,maturity,par.mid";B22;C22;B23;C23;"cols=3;rows=1")
  </code></pre>
  
  <p>And the loop to return this </p>
  
  <pre><code>14    =BCurveFwd(B10;startdate,maturity,par.mid";B22;C22;B23;C23;"cols=3;rows=1")
  15    =BCurveFwd(B11"startdate,maturity,par.mid";B22;C22;B23;C23;"cols=3;rows=1")
  16    =BCurveFwd(B12"startdate,maturity,par.mid";B22;C22;B23;C23;"cols=3;rows=1")
  17    =BCurveFwd(B13"startdate,maturity,par.mid";B22;C22;B23;C23;"cols=3;rows=1")
  </code></pre>
  
  <p>on rows 14 to 17 for example. </p>
  
  <p>I have tried </p>
  
  <pre><code>r = 14
  StartRow = 10
  LastRow = Range("B &amp; StartRow).End(xlDown).Row
  
  For i = StartRow To LastRow
  Range("B" &amp; r).Value = "=BCurveFwd(B" &amp; i &amp; ";"startdate,maturity,par.mid";B22;C22;B23;C23;"cols=3;rows=1")"
  
  r = r + 1
  Next i
  </code></pre>
  
  <p>I understand that the problem lies in that I don't know how to manipulate a text string with " in it. As Always, any help is appreciated. Thanks</p>