VBA R1C1 formatting question

stlpony

New Member
Joined
Mar 8, 2018
Messages
39
Hello!

I'm trying to enter an if statement within VBA ...

ActiveCell.FormulaR1C1 = _
"=IFERROR(IF((OR(RC[-1]=""Active Client - TOA"",OR(RC[-1]=""Past Client"")),""Yes"",""No""),""No"")"

If the cell to the left is either "Active Client - TOA" or "Pats Client" ... Return "Yes", if not, Return "no"

Any idea on my formula issue? I think it lies in the bolded area.

Thanks!
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
You've got too many ORs in there:

Code:
ActiveCell.FormulaR1C1 = _
"=IFERROR(IF(OR(RC[-1]=""Active Client - TOA"",RC[-1]=""Past Client""),""Yes"",""No""),""No"")"

or you can use:

Code:
ActiveCell.FormulaR1C1 = _
"=IFERROR(IF(OR(RC[-1]={""Active Client - TOA"",""Past Client""}),""Yes"",""No""),""No"")"
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,179
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top