Private Sub Worksheet_Change(ByVal target As range)
'Opmaak vertrek
For Each c In range("F3:F" & range("F1500").End(xlUp).Row)
If c = "SCHAARB.-VORM. BUNDEL C" Then
range("F" & c.Row, "G" & c.Row).Font.ColorIndex = 5
range("F" & c.Row, "I" & c.Row).Font.Bold = xlMedium
range("A" & c.Row, "D" & c.Row).Font.ColorIndex = 5
range("A" & c.Row, "D" & c.Row).Font.Bold = xlMedium
range("H" & c.Row, "I" & c.Row).Font.ColorIndex = 5
Else
range("F" & c.Row, "G" & c.Row).Font.ColorIndex = 1
range("F" & c.Row, "I" & c.Row).Font.Bold = False
range("A" & c.Row, "D" & c.Row).Font.ColorIndex = 1
range("A" & c.Row, "D" & c.Row).Font.Bold = False
range("H" & c.Row, "I" & c.Row).Font.ColorIndex = 1
End If
Next
'Opmaak aankomst
For Each o In range("G3:G" & range("G1500").End(xlUp).Row)
If o = "SCHAARB.-VORM. BUNDEL C" Then
range("G" & o.Row).Font.ColorIndex = 1
range("G" & o.Row).Font.Bold = False
' ElseIf o = "SCHAARB.-VORM. BUNDEL R" Then
' Range("G" & o.Row).Font.ColorIndex = 3
' ElseIf o = "SCHAARB.-VORM. BUNDEL P" Then
' Range("G" & o.Row).Font.ColorIndex = 10
' ElseIf o = "SCHAARB.-VORM. BUNDEL L" Then
' Range("G" & o.Row).Font.ColorIndex = 3
End If
Next
'Kleur Via
For Each v In range("K3:K" & range("K1500").End(xlUp).Row)
If v = "FBN" Then
range("K" & v.Row).Interior.ColorIndex = 43
ElseIf v = "FVV" Then
range("K" & v.Row).Interior.ColorIndex = 45
ElseIf v = "NVT" Then
range("K" & v.Row).Interior.ColorIndex = xlNone
End If
Next
'Randen
If target.Count = 1 Then
Select Case target.Column
Case 1
If target.Value >= "0" Then
target.Resize(, 19).Borders.Weight = xlThin
target.Offset(, 12).Resize(, 3).Borders.Weight = 3
End If
'Opmaak vertrek
Case 6
If target.Value = "SCHAARB.-VORM. BUNDEL C" Then Y = 5
If target.Value = "SCHAARB.-VORM. BUNDEL R" Then Y = 3
If target.Value = "SCHAARB.-VORM. BUNDEL P" Then Y = 10
If target.Value = "SCHAARB.-VORM. BUNDEL L" Then Y = 3
target.Offset(, -5).Resize(, 4).Font.ColorIndex = Y
target.Offset(, -5).Resize(, 4).Font.Bold = xlMedium
target.Resize(, 4).Font.ColorIndex = Y
target.Resize(, 4).Font.Bold = xlMedium
'target.Offset(, 8).Font.ColorIndex = Y
' target.Offset(, 12).Font.ColorIndex = Y
' target.Offset(, 12).Font.Bold = xlMedium
'Opmaak aankomst
Case 7
If target.Value = "SCHAARB.-VORM. BUNDEL C" Then Y = 1
If target.Value = "SCHAARB.-VORM. BUNDEL R" Then Y = 3
If target.Value = "SCHAARB.-VORM. BUNDEL P" Then Y = 10
If target.Value = "SCHAARB.-VORM. BUNDEL L" Then Y = 3
target.Font.ColorIndex = Y
'Opmaak via
Case 11
target.Interior.ColorIndex = IIf(target.Value = "FBN", 43, IIf(target.Value = "FVV", 45, xlNone))
'Spoor
Case 12
target.Interior.ColorIndex = IIf(target.Value >= "0", 36, xlNone)
'Opmaak rij
Case 18
If InStr(target.Value, "BOOK IN") Then target.Offset(, -17).Resize(, 10).Interior.ColorIndex = 36
If InStr(target.Value, "BOOK IN") Then target.Offset(, -5).Resize(, 6).Interior.ColorIndex = 36
If InStr(target.Value, "LINEAS") Then target.Offset(, -17).Resize(, 10).Interior.ColorIndex = 34
If InStr(target.Value, "LINEAS") Then target.Offset(, -5).Resize(, 6).Interior.ColorIndex = 34
'Opmaak vertraging vetrek
Case 4
If target.Value > target.Offset(, -1) Then target.Offset(, 1).Resize.Font.ColorIndex = 3
'If Target.Value > Target.Offset(, -1) Then
'UserForm7.Show
If target.Value <= target.Offset(, -1) Then target.Offset(, 1).Resize.Font.ColorIndex = 5
'Opmaak vertraging aankomst
Case 9
If target.Value > target.Offset(, -1) Then target.Offset(, 1).Resize.Font.ColorIndex = 3
If target.Value <= target.Offset(, -1) Then target.Offset(, 1).Resize.Font.ColorIndex = 5
End Select
End If
'ws_exit:
'Application.EnableEvents = True
End Sub