title: Excel Border For All Sheets
body: <p>I wonder is there a macro to add classic borders for all sheets which containing any text in cells.</p>
  
  <p>I tried with record macro but doesnt work for all sheets.</p>
  
  <pre><code>Sub TheWall()
  
  Application.ScreenUpdating = False
  Dim lngLstCol As Long, lngLstRow As Long
  
  lngLstRow = ActiveSheet.UsedRange.Rows.Count
  lngLstCol = ActiveSheet.UsedRange.Columns.Count
  
  For Each rngCell In Range("A2:A" &amp; lngLstRow)
      If rngCell.Value &gt; "" Then
          r = rngCell.Row
          c = rngCell.Column
          Range(Cells(r, c), Cells(r, lngLstCol)).Select
              With Selection.Borders
                  .LineStyle = xlContinuous
                  .Weight = xlThin
                  .ColorIndex = xlAutomatic
              End With
      End If
  Next
  
  Application.ScreenUpdating = True
  
  End Sub
  </code></pre>
  
  <p>Thanks For Your Help!</p>