title: Please help to Convert this formula to VBA code?
body: <p>I'm trying to convert this formula to VBA Code and it gives me unexpected result. Please help:</p>
  <p>the formula I want to convert is:  <code>=IF(B1=&quot;&quot;,&quot;&quot;,VLOOKUP(MONTH(B1),'Sheet3'!B:D,2,0))</code></p>
  <p>my code was:  <code>Sheet1.Range(&quot;D1&quot;).FormulaR1C1 = &quot;=IF(RC[-2]=&quot;&quot;&quot;&quot;,&quot;&quot;&quot;&quot;,VLOOKUP(MONTH(RC[-2]),&quot; &amp; Sheet3.Name &amp; &quot;!B:D,2,0))&quot;</code></p>
  <p>it gives me the result : <code>=IF(B1=&quot;&quot;,&quot;&quot;,VLOOKUP(MONTH(B1),**'(filename.xlsm)'**!b:(d),2,0))</code></p>