title: Unable to sort a column in Excel on Macros
body: <p>I am trying to record a macros that sort a column from A-Z but getting run-time error 1004. I clicked on debug and the line <code>ActiveCell.Offset(0, 21).Range("Table8[[#Headers],[Operations ticket]]").Select</code> is highlighted in yellow.</p>
  
  <p>This is my 1st time on VBA/Macros. Thank you for the help.</p>
  
  <pre><code>Sub Macro21()
  '
  ' Macro21 Macro
  '
  
  '
      ActiveCell.Offset(0, 21).Range("Table8[[#Headers],[Operations ticket]]").Select
      ActiveWorkbook.Worksheets("Sheet7").ListObjects("Table8").Sort.SortFields.Clear
      ActiveWorkbook.Worksheets("Sheet7").ListObjects("Table8").Sort.SortFields.Add _
          Key:=ActiveCell.Offset(-1, 0).Range("Table8[[#All],[Operations ticket]]"), _
          SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
      With ActiveWorkbook.Worksheets("Sheet7").ListObjects("Table8").Sort
          .Header = xlYes
          .MatchCase = False
          .Orientation = xlTopToBottom
          .SortMethod = xlPinYin
          .Apply
      End With
  </code></pre>