Sheets("Reference").Select Range("d9").Select Range(Selection, Selection.End(xlDown)).Select Range(Selection, Selection.End(xlToRight)).Select 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