vba formula error

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
 
R

RobcPettit

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
 
D

Dave Peterson

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.
 
P

Patrick Molloy

ActiveCell.FormulaR1C1 = "=IF(Results!R[-1]C[1] <>
"""",Results!R[-1]C[1],"""")"

this does result in correct formula.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top