Borders

The following is a simple way to add borders to a selection.

 

 
[sourcecode language="vb" light="true" wraplines="false" gutter="false"]

Sub AddBorders()
Dim myBorders() As Variant, item As Variant
myBorders = Array(xlEdgeLeft, _
xlEdgeTop, _
xlEdgeBottom, _
xlEdgeRight, _
xlInsideVertical)
For Each item In myBorders
With Selection.Borders(item)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Next item

End Sub
[/sourcecode]