Hello All,
I am trying to have my macro put in a formula and I am getting a error. The formula I was trying to put in was this:
I have it in VB as:
However, It is giving me a error. I imagine that the formula is too long but I am not sure. Any Ideas??
Please help!
Thanks
I am trying to have my macro put in a formula and I am getting a error. The formula I was trying to put in was this:
Code:
=IF(AND(OR(X2>0,Y2>0),(AND(AE2<=0,AF2<=0))),"Late PU",IF(AND(AND(X2<=0,Y2<=0),(OR(AE2>0,AF2>0))),"Late Del",IF(AND(OR(X2>0,Y2>0),(OR(AE2>0,AF2>0))),"Both",IF(AND(X2<=0,Y2<=0,AE2<=0,AF2<=0,AH2<>""),"LRC","NONE"))))
I have it in VB as:
Code:
Range("BV2").Select
ActiveCell.FormulaR1C1 = "=IF(AND(OR(RC[-52]>0,RC[-51]>0),(AND(RC[-45]<=0,RC[-44]<=0))),"Late PU",IF(AND(AND(RC[-52]<=0,RC[-51]<=0),(OR(RC[-45]>0,RC[-44]>0))),"Late Del",IF(AND(OR(RC[-52]>0,RC[-51]>0),(OR(RC[-45]>0,RC[-44]>0))),"Both",IF(AND(RC[-52]<=0,RC[-51]<=0,RC[-45]<=0,RC[-44]<=0,RC[-42]<>""),"LRC","NONE"))))"
Selection.AutoFill Destination:=Range("BV2:BV5000"), Type:=xlFillDefault
However, It is giving me a error. I imagine that the formula is too long but I am not sure. Any Ideas??
Please help!
Thanks