Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim deb As Range, i&
Application.ScreenUpdating = False
With Sh.UsedRange
.Borders.LineStyle = xlNone 'RAZ
Set deb = .Find("", , xlFormulas)
With deb.Resize(.Rows.Count - deb.Row + 1, .Columns.Count - deb.Column + 1)
.Borders.Weight = xlThin
For i = 7 To 10: .Borders(i).Weight = xlMedium: Next 'contour
For i = 1 To .Rows.Count
If i Mod 5 = 0 Then .Rows(i).Borders(xlEdgeBottom).Weight = xlMedium
Next
For i = 1 To .Columns.Count
If i Mod 5 = 0 Then .Columns(i).Borders(xlEdgeRight).Weight = xlMedium
Next
End With
End With
End Sub