The formula below is in a lengthy macro and it worked fine when the nested countif range uses numbers, i.e. countif(P6:P1000); I need a dynamic range however, and I've been trying to replace the range numbers with different versions of " & LstRw " but all I get is syntax errors. I assume I'm not using the quotation marks correctly somehow but I have tried about a thousand different versions so far without any luck.
<<Range("D1").Select
<< Selection.Formula = "=If(Countif(P6:P "" & LstRw & "" ,""W1D4*""),""ORDNANCE SCHOOL CURRENT FY CLIX"",If(CountIf(P6:P "" & LstRw & "" ,""W0G4*""),""165TH INF BDE CURRENT FY CLIX"", """"))"
If anyone could assist with the correct syntax to use the dynamic "& LstRw" in the nested countif it would be great.
Thanks,
JB
<<Range("D1").Select
<< Selection.Formula = "=If(Countif(P6:P "" & LstRw & "" ,""W1D4*""),""ORDNANCE SCHOOL CURRENT FY CLIX"",If(CountIf(P6:P "" & LstRw & "" ,""W0G4*""),""165TH INF BDE CURRENT FY CLIX"", """"))"
If anyone could assist with the correct syntax to use the dynamic "& LstRw" in the nested countif it would be great.
Thanks,
JB