Sub Appliquer_Les_Bordures(NomFeuille As String)
Dim DerCol As Integer
Dim DerLig As Long
Dim Bordure(), Elt As Variant
'Tableau avec le type de bordure à appliquer
Bordure = Array(xlEdgeTop, xlEdgeLeft, _
xlEdgeRight, xlInsideVertical)
With Worksheets(NomFeuille)
If Not IsEmpty(.UsedRange) Then
DerLig = .Cells.Find("*", LookIn:=xlValues, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
DerCol = .Cells.Find("*", LookIn:=xlValues, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious).Column
With .Range("A19", .Cells(DerLig, DerCol - 3))
For Each Elt In Bordure
With .Borders(Elt)
.LineStyle = xlContinuous
.Weight = xlThin 'Or Thick
'Constantes couleurs disponibles
'vbRed , VBBroun, vbGreen, vbWhite
'vbCyan, vbBlue, vbYellow
.Color = vbBlack
End With
Next
End With
'========================================================
With .Range("C19", .Cells(DerLig, 3))
.Borders(xlEdgeLeft).LineStyle = xlNone
End With
End If
End With
End Sub