Sub test_A()
Dim Plg As Range
Set Plg = Range("A2", Cells(Rows.Count, "G").End(3))
BorderMaker Plg, xlDashDotDot, xlMedium, vbRed, True
End Sub
Sub test_B()
Dim Plg As Range
Set Plg = Range("A2", Cells(Rows.Count, "G").End(3))
BorderMaker Plg, xlDouble, xlHairline, vbGreen, False
End Sub
Private Sub BorderMaker(rng As Range, lStyle As XlLineStyle, Trait As XlBorderWeight, Couleur As XlColorIndex, Contour As Boolean)
rng.Borders.LineStyle = lStyle
rng.Borders.Weight = Trait
rng.Borders.Color = Couleur
rng.BorderAround IIf(Contour, 1, xlNone), IIf(Contour, xlThick, xlThin)
End Sub