1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| Sub Test()
MF_Bordure Range(Cells(1, 1), Cells(12, 6))
End Sub
Sub MF_Bordure(R As Range)
R.Borders(xlDiagonalDown).LineStyle = xlNone
R.Borders(xlDiagonalUp).LineStyle = xlNone
With R.Borders(xlEdgeLeft)
.LineStyle = xlSlantDashDot
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlMedium
End With
With R.Borders(xlEdgeTop)
.LineStyle = xlSlantDashDot
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlMedium
End With
With R.Borders(xlEdgeBottom)
.LineStyle = xlSlantDashDot
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlMedium
End With
With R.Borders(xlEdgeRight)
.LineStyle = xlSlantDashDot
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlMedium
End With
With R.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThin
End With
With R.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThin
End With
End Sub |