It's the easiest thing in the world to sort a column alphabetically. But what if you have a column with a bunch of words in each row, and you want to sort the words within each cell?
For instance:
A1 - Tom ate lunch
A2 - Alex brought animal cookies
A3 - Games were played
I want to sort each sentence. A1 should be "ate lunch Tom," see.
1. I approached it by splitting the cells into columns, first. (Data > Text to Colums > Space delimited)
2. Then I ran the following macro:
===============================
Sub AlphaRowSort()
'
' AlphaRowSort Macro
' By Tom Dalton
'
'
Do Until ActiveCell.Value = ""
ActiveCell.Range("A1:Z1").Select
Selection.Sort Key1:=ActiveCell, Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlLeftToRight, _
DataOption1:=xlSortNormal
ActiveCell.Offset(1, 0).Select
Loop
End Sub
=====================
3. Then I copied all the cells into notepad to clean it, copied that into Word, replaced all the tabs with spaces, and finally dumped it back into Excel.
If I were any good at writing macros, of course, I'd have put all the splitting and recombining into the macro as well. But I'm not -- I'm not a programmer! I just get things done. And this got done in time. So I'm a happy boy.