Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim MaPlage As Range, i&, j&, Derlig&
Derlig = Range("A" & Rows.Count).End(xlUp).Row
Set MaPlage = Range("A1:A" & Derlig)
Columns(1).Borders(xlDiagonalUp).LineStyle = xlNone
If Not Application.Intersect(MaPlage, Range(Target.Address)) Is Nothing Then
For i = 1 To Derlig
If Range("A" & i) < 10 Then
For j = 5 To 6
With Range("A" & i)
.Borders(j).LineStyle = 1
End With
Next j
End If
Next i
End If
End Sub