Hi - I've been playing around for over an hour and keep getting different errors!
How can I get this code to exit sub if Target.Address = "D3" Is Blank?
My Code;
Thank you!
How can I get this code to exit sub if Target.Address = "D3" Is Blank?
My Code;
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$3" Is Nothing Then
Exit Sub
Else
Range("$D$4").FormulaArray = "=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 = "=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 = "=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 = "=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 = "=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 = "=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 = "=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 = "=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 = "=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 = "=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 = "=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
End Sub
Thank you!