' sortRows macro by Robert Simms Dec 1998 - Dec 2000
'
' The purpose is to make it easy to sort students' quiz or
' homework grades to make it possible to eliminate more than one
' of the lowest ones.
'
' Simply select the cells that you want to sort and the
' contents of each row within that selection will be
' sorted independently by running this macro. Don't select
' entire rows when you only want to sort some of the cells.
'
' A toolbar has been attached to this spreadsheet with a button that
' activates this macro.
Sub sortRows()
Dim a As Range
Set a = Selection
Application.ScreenUpdating = False
For Each r In a.Rows
r.Select
Selection.Sort Key1:=r, Order1:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlLeftToRight
Next
Application.ScreenUpdating = True
a.Select
End Sub