title: Making an Array Which Completes All Border Settings In One Sweep
body: <p>I'm trying to set up an array to pull the types of border in excel so I can create all my borders in a couple of lines, rather than the >40 normally</p>
  
  <p>I'm clearly missing something obvious, but at the moment I can't work it out
  Could someone please assist with this?</p>
  
  <p>Current error:
   <code>Object doesn't support this property or method (Error 438)</code></p>
  
  <p>This pulls to the <code>.LineStyle = xlContinuous</code> line</p>
  
  <p>Is <code>i</code> not the right way to go for this? Any help is appreciated</p>
  
  <pre><code>Dim wb As Workbook, ws As Worksheet, rng As Range, LastRow As Long, rng2 As Range, borderType, i
  
  borderType = Array("xlEdgeLeft", "xlEdgeTop", "xlEdgeBottom", "xlEdgeRight", "xlInsideVertical", "xlInsideHorizontal")
  Set wb = ThisWorkbook
  Set ws = Worksheets("Data")
  Set rng = ws.Cells(1, 1)
  
      LastRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row                  'Finds the bottom populated row
  
  Set rng2 = ws.Range(rng, ws.Cells(LastRow, 15))
  
      With rng2
          .AutoFilter
          .EntireColumn.AutoFit
          .Borders(xlDiagonalDown).LineStyle = xlNone
          .Borders(xlDiagonalUp).LineStyle = xlNone
  
  
          For Each i In borderType
              .LineStyle = xlContinuous
              .ColorIndex = 0
              .TintAndShade = 0
              .Weight = xlThin
          Next
  
      End With
  </code></pre>