TIP: Add cell borders

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

TIP: Add cell borders

Post by Rudi »

Hi,

Recorded macros that add cell borders list an essay of properties for topedge, bottomedge, leftedge, rightedge, horozontal, inside....settings
It is way too much detail if you simply want full borders around your selection or range reference.

Here is the short version... You simply need 1 (or 2) lines for FULL or AROUND borders.
Please note that the .Borders property DOES NOT have arguments like the BorderAround property!

Code: Select all

Sub AddBorders()
    Selection.Borders.Weight = xlThin
    Selection.BorderAround ColorIndex:=3, Weight:=xlThick
End Sub
See BorderAround settings here: http://msdn.microsoft.com/en-us/library ... e.11).aspx
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.