Hi- this is my first time posting in the forum as I am a newer VBA user. I hope you can help.
ActiveCell.FormulaR1C1 = _
""
I am trying to paste the formulas below into the "" above and am getting an error. It says Compile Error, Expected: line number or label or statement or end of statement. I suspect that this error might be coming up because I have too many functions in one cell. The formula below works in excel do you know why it doesn't work in VBA? Is there a better way to do this? I think this might be a beginner error.
=IF(OR(RC[-5]="Default to MIP pricing",RC[-5]="Not Traded"),"Not Traded",IF(RC[2]="IG",IF(AND(OR(RC[-5]="Priced to Maturity",RC[-5]="Priced to Call"),RC[-21]<>R1C3),"TRACE >$1mm traded on "&TEXT(RC[-21],"mm/dd/yyyy")&" at "&MROUND(RC[-20],0.01)&" / "&MROUND(RC[-15],1)&"bps adjusted to "&MROUND(RC[-9],1)&"bps based on "&IF(AND(RC[-12]<>"",ABS(RC[-12])<0.1),"CDS change of "&MROUND(ABS(RC[-12]*100),0.01)*SIGN(RC[-12])&"%","LUCI change of "&MROUND(ABS(RC[-11]*100),0.01)*SIGN(RC[-11])&"%"),IF(AND(OR(RC[-5]="Using Trade PX",RC[-21]=R1C3),ISERROR("TRACE >$1mm traded on "&TEXT(RC[-21],"mm/dd/yyyy")&" at "&MROUND(RC[-20],0.01)&" / "&MROUND(RC[-15],1)&"bps")),"TRACE >$1mm traded on "&TEXT(RC[-21],"mm/dd/yyyy")&" at "&MROUND(RC[-20],0.01),"TRACE >$1mm traded on "&TEXT(RC[-21],"mm/dd/yyyy")&" at "&MROUND(RC[-20],0.01)&" / "&MROUND(RC[-15],1)&"bps")),IF(RC[-21]>R5C3,"TRACE >$1mm traded on "&TEXT(RC[-21],"mm/dd/yyyy")&" at "&MROUND(RC[-20],0.01),"TRACE >$1mm traded on "&TEXT(RC[-21],"mm/dd/yyyy")&" at "&MROUND(RC[-20],0.01)&" adjusted by HY index change of "&MROUND(ABS(RC[-11]*100),0.01)*SIGN(RC[-11])&"%")))
Hopefully you can help!
Bookmarks