Sub Bordures()
Sheets("ce0").Unprotect
x = Sheets("ce0").Cells(18, 60).End(xlDown).Row - 17
y = Sheets("ce0").Cells(18, 60).End(xlToRight).Column - 59
Sheets("ce0").Select
For J = 1 To y
If J <= 5 Then
For I = 1 To x
If I <= 15 Then
Debug.Print Cells(17 + I, 59 + J).Address(0, 0)
If Sheets("mesures").Cells(17 + I, 59 + J) <> "" Then
Cells(17 + I, 59 + J).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlThin
End With
End If
End If
Next I
End If
Exit For
Next J
Sheets("ce0").Protect
End Sub