View Single Post
 
Old 07-28-2014, 12:35 PM
whatsup whatsup is offline Windows 7 64bit Office 2010 32bit
Competent Performer
 
Join Date: May 2014
Posts: 137
whatsup will become famous soon enough
Default

Hi Mike

If you're fine with the default of borders, you don't have to include all properties. What you've got, is the result of the macro-recorder, which includes the properties to show what's possible.

Still, it's not a lot shorter because borders are applied in sections:

Code:
Sub Do_Borders()
With Range("AG2:AH6")
    .Borders(xlEdgeLeft).LineStyle = xlContinuous
    .Borders(xlEdgeTop).LineStyle = xlContinuous
    .Borders(xlEdgeBottom).LineStyle = xlContinuous
    .Borders(xlEdgeRight).LineStyle = xlContinuous
    .Borders(xlInsideVertical).LineStyle = xlContinuous
    .Borders(xlInsideHorizontal).LineStyle = xlContinuous
End With
End Sub
Reply With Quote