I've been stuck on this for the past couple of hours and it's driving me nuts. I'm trying to enter this formula in cell B2:
=IF(OR(C2="Yes",D2="Yes",E2="Yes",F2="Yes",G2="Yes",H2="Yes",I2="Yes"),"Yes",IF(AND(C2="No",D2="No",E2="No",F2="No",G2="No",H2="No",I2="No"),"No"))
The formula works fine but no formula is entered into the cell when run through a VBA macro.
I recorded the macro, copy-and-pasted the output, and the cell still remains blank. Here is the output from the recording:
Range("B2").Select
ActiveCell.FormulaR1C1 = _
"=IF(OR(RC[1]=""Yes"",RC[2]=""Yes"",RC[3]=""Yes"",RC[4]=""Yes"",RC[5]=""Yes"",RC[6]=""Yes"",RC[7]=""Yes""),""Yes"",IF(AND(RC[1]=""No"",RC[2]=""No"",RC[3]=""No"",RC[4]=""No"",RC[5]=""No"",RC[6]=""No"",RC[7]=""No""),""No""))"
I've also tried Range("B2").Formula, without success.
Any suggestions? Thanks!
=IF(OR(C2="Yes",D2="Yes",E2="Yes",F2="Yes",G2="Yes",H2="Yes",I2="Yes"),"Yes","No")Only making your Formula smaller to make debugging easier. This is ofcourse unless you want to add another condition at the end after the last NO. So the formula reads if any of the cells are Yes then return aYeselse if ALL of the cells are NO then return a NO. (can be achieved with the shortened formula included in this comment) - izzymoselectall the way up, it just moved there. B1 was empty so it filled that down. Should've debugged better. I was dead tired at the time. Thanks for the help, everyone. - EricY