Private Sub Worksheet_Change(ByVal Target As Range)
Dim n As Long, lngIndex As Long, fngindex As Long, CONS
' clear contents causes a change event procedure to fire, which will continue endlessly
' unless enable events are disabled
If Range("C5") = "SDK*" Then
Sheets("Charts").Range("VAL1CELL") = "SDK UK"
Else
Sheets("Charts").Range("VAL1CELL") = Range("C5")
End If
Sheets("Charts").Range("VAL2CELL") = Sheets("Charts").Range("Y$41")
If Not Intersect(Target, Me.Range("$C$5")) Is Nothing Then Me.Calculate
If Not Intersect(Target, Me.Range("$U$3")) Is Nothing Then Me.Calculate
If Not Intersect(Target, Me.Range("$S$36")) Is Nothing Then Me.Calculate
If Range("Y7").Value = "True" Then
MsgBox " Please contact Lorraine or Marcus before submitting", 0, "Probabtionary Consultant"
End If
If ActiveCell.Address = "$U$3" Then Me.Calculate
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("$C$5")) Is Nothing Then Me.Calculate
If ActiveCell.Address = "$C$5" Then Range("U$3") = Range("c$8")
Me.Calculate
If Not Intersect(Target, Me.Range("$U$3")) Is Nothing Then Range("U10, U12, U16, U18, U22, U25, U27, U29, S36").ClearContents
Application.ScreenUpdating = False
For n = 7 To 125
If Cells(n, "A").Value = 1 Then
' orange
lngIndex = 45
fngindex = 1
ElseIf Cells(n, "H").Value = "Reached" Then
' yellow
lngIndex = 6
fngindex = 1
ElseIf Cells(n, "I").Value = 1 Then
' green
lngIndex = 4
fngindex = 1
ElseIf Cells(n, "G").Value Like "6 Months" Then
' Purple
lngIndex = 13
fngindex = 2
ElseIf Cells(n, "G").Value = "7 Months" Then
' Purple
lngIndex = 1
fngindex = 2
ElseIf Cells(n, "G").Value = "8 Months" Then
' Purple
lngIndex = 13
fngindex = 2
ElseIf Cells(n, "G").Value = "9 Months" Then
' Purple
lngIndex = 13
fngindex = 2
ElseIf Cells(n, "G").Value = "10 Months" Then
' Purple
lngIndex = 13
fngindex = 2
ElseIf Cells(n, "G").Value = "11 Months" Then
' Purple
lngIndex = 13
fngindex = 2
ElseIf Cells(n, "G").Value = "12 Months" Then
' Purple
lngIndex = 13
fngindex = 2
ElseIf Cells(n, "G").Value = "13 Months" Then
' Purple
lngIndex = 13
fngindex = 2
ElseIf Cells(n, "G").Value = "14 Months" Then
' Purple
lngIndex = 13
fngindex = 2
ElseIf Cells(n, "G").Value = "15 Months" Then
' Purple
lngIndex = 13
fngindex = 2
ElseIf Cells(n, "G").Value = "16 Months" Then
' Purple
lngIndex = 13
fngindex = 2
ElseIf Cells(n, "G").Value = "17 Months" Then
' Purple
lngIndex = 13
fngindex = 2
ElseIf IsDate(Cells(n, "G").Value) Then
' Red
lngIndex = 3
fngindex = 1
ElseIf Cells(n, "A").Value = 2 Then
' grey
lngIndex = 48
fngindex = 1
Else
' no colour
lngIndex = xlColorIndexNone
fngindex = 1
End If
Range(Cells(n, "C"), Cells(n, "G")).Interior.ColorIndex = lngIndex
Range(Cells(n, "C"), Cells(n, "G")).Font.ColorIndex = fngindex
Next n
If Not Intersect(Target, Me.Range("$u$10")) Is Nothing Then
If Range("Y3").Value = "FALSE2" Then
CONS = Range("U3")
MsgBox CONS & " has been held back for disciplinary purposes, please contact Personnel"
Range("U10").ClearContents
If Not Intersect(Target, Me.Range("$s$36")) Is Nothing Then
If Range("Y7").Value = "True" Then
MsgBox " Test"
Exit Sub
End If
End If
End If
End If
Me.Calculate
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub