title: Getting run-time 1004: Method 'Range' of object '_Worksheet' failed when using cells
body: <pre><code>Sub WorksheetLoop()
        Dim sht As Worksheet
        Dim LastRow As Long
        Dim LastColumn As Long
        Dim StartCell As Range
        Dim objTable As ListObject
  
        Dim WS_Count As Integer
        Dim I As Integer
  
        WS_Count = ActiveWorkbook.Worksheets.Count
  
  
         For I = 1 To WS_Count
              Set sht = Worksheets(I)
              Set StartCell = Range("A2")
  
              LastRow = sht.Cells(sht.Rows.Count, StartCell.Column).End(xlUp).Row
              LastColumn = sht.Cells(StartCell.Row, sht.Columns.Count).End(xlToLeft).Column
  
              ' error on next line
              sht.Range(StartCell, sht.Cells(LastRow, LastColumn)).Select
  
              Set objTable = ActiveSheet.ListObjects.Add(xlSrcRange, Selection, , xlYes)
  
              MsgBox ActiveWorkbook.Worksheets(I).Name
  
              Next I
  
  End Sub
  </code></pre>