PJ Paul,
You did not say if you wanted to sort ascending, or, descending?
In the below macro code, the:
order1:=
1
the
1 stands for ascending
a 2 stands for descending
Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).
1. Copy the below code
2. Open your NEW workbook
3. Press the keys
ALT +
F11 to open the Visual Basic Editor
4. Press the keys
ALT +
I to activate the Insert menu
5. Press
M to insert a Standard Module
6. Where the cursor is flashing, paste the code
7. Press the keys
ALT +
Q to exit the Editor, and return to Excel
8. To run the macro from Excel press
ALT +
F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.
Code:
Option Explicit
Sub SortMyData()
' hiker95, 03/11/2014, ME763305
Dim lr As Long
With Sheets("Sheet1")
lr = .Cells(Rows.Count, "E").End(xlUp).Row
.Range("A2:F" & lr).Sort key1:=.Range("E2"), order1:=1
End With
End Sub
Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension
.xlsm
Then run the
SortMyData macro.