lundi 30 mars 2015

Excel not reading VBA formula

I've been stuck on this for the past couple of hours and it's driving me nuts. I'm trying to enter this code 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"))


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!


Aucun commentaire:

Enregistrer un commentaire