ActiveCell.FormulaR1C1

S

Slohcin

I have the following lines in my code:

ActiveCell.FormulaR1C1 = "=IF(RC[6]=""AA"",""ST"",""EA"")"
Range("D2").Select

This sets the value of one cell to ST if another equals AA, if not it sets
the value to EA. I have now found that AA may be AA or AB or AX but I still
need the second cell to be set to ST or EA, how do I do this?
 
S

Sam Wilson

ActiveCell.FormulaR1C1 =
"=IF(OR(RC[6]=""AA"",RC[6]=""AB"",RC[6]=""AX""),""ST"",""EA"")"
 
S

Slohcin

Many thanks Sam for your quick response and solution.
--
Thanks
Slohcin


Sam Wilson said:
ActiveCell.FormulaR1C1 =
"=IF(OR(RC[6]=""AA"",RC[6]=""AB"",RC[6]=""AX""),""ST"",""EA"")"


Slohcin said:
I have the following lines in my code:

ActiveCell.FormulaR1C1 = "=IF(RC[6]=""AA"",""ST"",""EA"")"
Range("D2").Select

This sets the value of one cell to ST if another equals AA, if not it sets
the value to EA. I have now found that AA may be AA or AB or AX but I still
need the second cell to be set to ST or EA, how do I do this?
 
D

Dave Peterson

Another one that is a little easier to update if/when things change:

ActiveCell.FormulaR1C1 _
= "=IF(OR(RC[6]={""AA"",""AB"",""AX""}),""ST"",""EA"")"



I have the following lines in my code:

ActiveCell.FormulaR1C1 = "=IF(RC[6]=""AA"",""ST"",""EA"")"
Range("D2").Select

This sets the value of one cell to ST if another equals AA, if not it sets
the value to EA. I have now found that AA may be AA or AB or AX but I still
need the second cell to be set to ST or EA, how do I do this?
 

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

Top