Quotes in formula

  • Thread starter Thread starter Kevin
  • Start date Start date
K

Kevin

I am trying to put a formula into excel using the
following VBA code. I am having problems getting the
quotes around "sp50.R". Quotes need to show up in Excel,
but I'm not sure how to make them appear.

DateToUse = ActiveCell.Offset(0, -4).Value
ActiveCell.Formula = "^=(100*(RELATIVE
("sp50.R",1+P_TOTAL_RETURNC(" & DateToUse & ",0)/100)-1))
+100"
ActiveCell.Offset(1, 0).Select


Thank you!
Kevin
 
Quotes in VBA, like in XL strings, must be doubled:

ActiveCell.Formula = _
"=(100*(RELATIVE(""sp50.R"",1+P_TOTAL_RETURNC(" & _
DateToUse & ",0)/100)-1))+100"
 
Back
Top