Petite amélioration de ton code :

Dim a As Integer
For a = 5 To Profondeurson Step 2
With Cells(a, 5).Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic...