Or, the super-quick way...
Copy column A and paste it in column E. Copy column B and paste it in
column D. Select any cell in D or E and do the Data - Sort thing. Then
delete column C.
And if you do all this using the macro recorder, you'll have your code!