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