I hope you are well.
You might need an error check in there to find the last non empty row. Code snippet below on how I would approach this. Your code would also most likely throw an error if there is only 1 row of data hence another check for lrow < 2.
Thanks!
Sub SortByCol5()
Dim ws As Worksheet
Dim lrow As Long
Dim sortRange As Range
Set ws = ThisWorkbook.Worksheets("Sheet2")
'Find last used row in sheet'
lrow = ws.Cells(ws.Rows.Count, "E").End(xlUp).Row
'Error check for only 1 row'
If lrow < 2 Then Exit Sub
Set sortRange = ws.Range("A2:E" & lrow)
sortRange.Sort _
Key1:=ws.Range("E2:E" & lrow), _
Order1:=xlAscending, _
Header:=xlNo
End Sub