The following formula works fine in vba:
faddress=Range(ActiveCell.Offset(0,-15),ActiveCell.Offset(0,-15).End(xlUp).End(xlToRight).Offset(0, -4)).Address
ActiveCell.FormulaArray = "=if(countif(" & faddress & ",""hrcmp"")>0,IF(COUNTIF(" & faddress & ",""hrpay"")>0,""HRCMP/HRPay Mix"",""""),"""")"
However, when I change the formula to this the 1004 error code occurs. I am sure it has something to do with mixing formula styles don't know how to fix it.
ActiveCell.Formula = "=IF(RC[-19]=R[-1]C[-19]),if(countif(" & faddress
&",""hrcmp"")>0,IF(COUNTIF(" & faddress & ",""hrpay"")>0,""HRCMP/HRPay Mix"","""")),""""))"
Please help... thank you in advance.
faddress=Range(ActiveCell.Offset(0,-15),ActiveCell.Offset(0,-15).End(xlUp).End(xlToRight).Offset(0, -4)).Address
ActiveCell.FormulaArray = "=if(countif(" & faddress & ",""hrcmp"")>0,IF(COUNTIF(" & faddress & ",""hrpay"")>0,""HRCMP/HRPay Mix"",""""),"""")"
However, when I change the formula to this the 1004 error code occurs. I am sure it has something to do with mixing formula styles don't know how to fix it.
ActiveCell.Formula = "=IF(RC[-19]=R[-1]C[-19]),if(countif(" & faddress
&",""hrcmp"")>0,IF(COUNTIF(" & faddress & ",""hrpay"")>0,""HRCMP/HRPay Mix"","""")),""""))"
Please help... thank you in advance.