vba formula error

  • Thread starter Thread starter RobcPettit
  • Start date Start date
R

RobcPettit

hi, im using ActiveCell.FormulaR1C1 = "=IF(Results!R[-1]C[1]
<>"""",Results!R[-1]C[1],"""")" which should give me =IF(Results!
A3<>"",Results!A3,"") but instead gives me =IF
(Results!'A3'<>"",Results!'A3',""). Any ideas how to get rid of those
' .
Regards Robert
 
Sorry I discovered my error I was using Activecell.FormulaR1C1= "=IF
(Results!'A3'<>"",Results!'A3',"")" were I should have used
Activecell = "=IF(Results!'A3'<>"",Results!'A3',"")".
Regards robert
 
I don't think so.

If you're using .formulaR1C1, then you should use R1C1 reference style.

Maybe you meant that this correction worked:

Activecell.Formula = "=IF(Results!A3<>"""",Results!A3,"""")"

You have to double up those double quotes, too.
 
ActiveCell.FormulaR1C1 = "=IF(Results!R[-1]C[1] <>
"""",Results!R[-1]C[1],"""")"

this does result in correct formula.
 
Back
Top