View Single Post
 
Old 12-05-2010, 07:52 AM
BjornS BjornS is offline Windows Vista Office 2003
Competent Performer
 
Join Date: Jan 2010
Location: Sweden
Posts: 116
BjornS is on a distinguished road
Default

Hi,
implement the macro below.

First select the matrix you want to sort. Then run the macro.
That should fix it.

Kind regards
Bjorn


Sub Sort1()
Dim rr As Integer, rng1 As Range, rng2 As Range, maxcol As Integer

Set rng1 = Selection
maxcol = rng1.Columns.Count

For rr = 1 To rng1.Rows.Count
Set rng2 = Range(rng1.Cells(rr, 1), rng1.Cells(rr, maxcol))

rng2.Sort Key1:=rng2.Cells(1, 1), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlLeftToRight, _
DataOption1:=xlSortNormal

Next rr
End Sub
Reply With Quote