Hi - I have this code but it keeps chucking up a syntax error at this part;
Full Code;
Any idea why this might be?
Thank you
Code:
Range("E20").Formula = "IF(AND(D20=1,COUNTIF($C$4:$C$6,">="&1)=3),"Yes",IF(AND(OR(D20=2,D20="3A",D20="3B",D20=4,D20=5),COUNTIF($C$4:$C$6,">="&1)>=1),"Yes","No"))"
Full Code;
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("D3")) Is Nothing Then
Exit Sub
Else
Range("$D$4").FormulaArray = Evaluate("INDEX(Roles!$B$2:$AH$12,MATCH('Maps'!B4,Roles!$A$2:$A$12,0),MATCH('Maps'!D3,Roles!$B$1:$AH$1,0))")
Range("$D$5").FormulaArray = Evaluate("INDEX(Roles!$B$2:$AH$12,MATCH('Maps'!B5,Roles!$A$2:$A$12,0),MATCH('Maps'!D3,Roles!$B$1:$AH$1,0))")
Range("$D$6").FormulaArray = Evaluate("INDEX(Roles!$B$2:$AH$12,MATCH('Maps'!B6,Roles!$A$2:$A$12,0),MATCH('Maps'!D3,Roles!$B$1:$AH$1,0))")
Range("$D$7").FormulaArray = Evaluate("INDEX(Roles!$B$2:$AH$12,MATCH('Maps'!B7,Roles!$A$2:$A$12,0),MATCH('Maps'!D3,Roles!$B$1:$AH$1,0))")
Range("$D$8").FormulaArray = Evaluate("INDEX(Roles!$B$2:$AH$12,MATCH('Maps'!B8,Roles!$A$2:$A$12,0),MATCH('Maps'!D3,Roles!$B$1:$AH$1,0))")
Range("$D$9").FormulaArray = Evaluate("INDEX(Roles!$B$2:$AH$12,MATCH('Maps'!B9,Roles!$A$2:$A$12,0),MATCH('Maps'!D3,Roles!$B$1:$AH$1,0))")
Range("$D$10").FormulaArray = Evaluate("INDEX(Roles!$B$2:$AH$12,MATCH('Maps'!B10,Roles!$A$2:$A$12,0),MATCH('Maps'!D3,Roles!$B$1:$AH$1,0))")
Range("$D$11").FormulaArray = Evaluate("INDEX(Roles!$B$2:$AH$12,MATCH('Maps'!B11,Roles!$A$2:$A$12,0),MATCH('Maps'!D3,Roles!$B$1:$AH$1,0))")
Range("$D$12").FormulaArray = Evaluate("INDEX(Roles!$B$2:$AH$12,MATCH('Maps'!B12,Roles!$A$2:$A$12,0),MATCH('Maps'!D3,Roles!$B$1:$AH$1,0))")
Range("$D$13").FormulaArray = Evaluate("INDEX(Roles!$B$2:$AH$12,MATCH('Maps'!B13,Roles!$A$2:$A$12,0),MATCH('Maps'!D3,Roles!$B$1:$AH$1,0))")
Range("$D$14").FormulaArray = Evaluate("INDEX(Roles!$B$2:$AH$12,MATCH('Maps'!B14,Roles!$A$2:$A$12,0),MATCH('Maps'!D3,Roles!$B$1:$AH$1,0))")
End If
If Intersect(Target, Range("D20")) Is Nothing Then
Exit Sub
Range("E20").Formula = "IF(AND(D20=1,COUNTIF($C$4:$C$6,">="&1)=3),"Yes",IF(AND(OR(D20=2,D20="3A",D20="3B",D20=4,D20=5),COUNTIF($C$4:$C$6,">="&1)>=1),"Yes","No"))"
End If
End Sub
Any idea why this might be?
Thank you
Last edited: