title: VBA Borders Excel Dependent on Page Size
body: <p>I want to create borders around each of my excel pages dependent on the size of the page e.g. number of rows and columns can vary all the time. I've tried this but it's specific cells </p>
  
  <pre><code> Sub AddBorders()
  
   With Range("B8:I10")
       .Borders(xlEdgeLeft).LineStyle = xlContinuous
       .Borders(xlEdgeRight).LineStyle = xlContinuous
       .Borders(xlEdgeBottom).LineStyle = xlContinuous
       .Borders(xlEdgeTop).LineStyle = xlContinuous End With End Sub
  </code></pre>