This is my VBA code:
Sub AutoRunMacro()
Range("N5").Formula = "=SUM(COUNTIF(F5:M5;""*Pending*"")+COUNTIF(F5:M5;""*Rejected*"")+COUNTIF(F5:M5;""*Expired*"")+COUNTIF(F5:M5;""*Incomplete*"")+COUNTIF(F5:M5;""*Empty*"")) / COUNTIF(F5:M5;""<>*N/A*"")"
End Sub
Every time I open this file, the macro is executed, but this error shows up:
Run-time error '1004' : Method 'Range' of object'_Global' failed
Do you guys know how to solve it? Thanks!