I have some code to sort all sheets column E low to high. I have 18 sheets each with about a million rows. I can sort one sheet manually and it takes maybe 5 seconds. When I use this code, the 18 sheets take almost 10 min.
I will have any number sheets, depending on previous calculations. In this instance, it is 18.
Also, it takes way more memory than I would expect.
Thanks for any help
I will have any number sheets, depending on previous calculations. In this instance, it is 18.
Also, it takes way more memory than I would expect.
Thanks for any help
Code:
Sub SortAllSheets()
'Descending sort on A:E using column E, all sheets in workbook
Dim ws As Worksheet
For Each ws In Worksheets
ws.Columns("A:E").Sort Key1:=ws.Columns("E"), Order1:=xlAscending
Next ws
End Sub