I've inserted the below formula into VBA but am getting VBA Run Time Error 1004 - "Range of object_Global failed" - not sure what I'm missing.
Formula works in Excel but not when I translate to VBA.
Range("AF") ="=IF(OR(AND(LEN('ACCOUNT DATA'!V2)=8,LEFT('ACCOUNT DATA'!V2,2)=""60""),LEFT('ACCOUNT DATA'!V2,3)=""CSN""),""CDR Created"",IF(OR(AND(LEN('ACCOUNT DATA'!X2)=8,LEFT('ACCOUNT DATA'!X2,2)=""60""),LEFT('ACCOUNT DATA'!X2,3)=""CSN""),""CDR Created"",IF(OR(AND(LEN('ACCOUNT DATA'!Y2)=8,LEFT('ACCOUNT DATA'!Y2,2)=""60""),LEFT('ACCOUNT DATA'!Y2,3)=""CSN""),""CDR Created"",""CDR Pending"")))"
CORRECTED FORMULA: I was missing the row number in my range... so AF2 instead of AF:
Range("AF2") ="=IF(OR(AND(LEN('ACCOUNT DATA'!V2)=8,LEFT('ACCOUNT DATA'!V2,2)=""60""),LEFT('ACCOUNT DATA'!V2,3)=""CSN""),""CDR Created"",IF(OR(AND(LEN('ACCOUNT DATA'!X2)=8,LEFT('ACCOUNT DATA'!X2,2)=""60""),LEFT('ACCOUNT DATA'!X2,3)=""CSN""),""CDR Created"",IF(OR(AND(LEN('ACCOUNT DATA'!Y2)=8,LEFT('ACCOUNT DATA'!Y2,2)=""60""),LEFT('ACCOUNT DATA'!Y2,3)=""CSN""),""CDR Created"",""CDR Pending"")))"
myRange.Formula = "=IF(OR(AND(...)))"
– kolcinx