title: VBA 2016 compatibility issue
body: <p>The code works fine in Excel 2013 and Excel 2010 - but in Excel 2016 it shows error:</p>
  
  <blockquote>
    <p>Run time error 9 - subscript out of range</p>
  </blockquote>
  
  <p>Can you help. The code just sorts a column and hides it.</p>
  
  <pre><code>Sub abc()
      Sheets("Top_Issue").Visible = True
      Sheets("Top_Issue").Select
      lastrow = Cells(Rows.Count, "a").End(xlUp).Row
      Range(Cells(1, "p"), Cells(lastrow, "p")).Select
      ActiveWorkbook.Worksheets("Top_Issue").Sort.SortFields.Clear
      ActiveWorkbook.Worksheets("Top_Issue").Sort.SortFields.Add Key:=Range("P1"), _
      SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
      With ActiveWorkbook.Worksheets("Top_Issue").Sort
          .SetRange Range("A2:S" &amp; lastrow)
          .Header = xlYes
          .MatchCase = False
          .Orientation = xlTopToBottom
          .SortMethod = xlPinYin
          .Apply
      End With
      Sheets("Top_Issue").Visible = False
  End Sub
  </code></pre>