macro to sort right to left

S

Steve

Help please!

I need a macro to sort numbers left-to-right in cells C2 to G2

these numbers continue down the columns for about 600

I can't get the macro I need to move down a sort each row in turn.

Thanks in advance

Steve
 
B

Bernie Deitrick

Steve,

You may need to change xlAscending to xlDescending:

Sub SteveSort()
Dim myC As Range

For Each myC In Range(Range("C2"), Cells(Rows.Count, 3).End(xlUp))
myC.Resize(1, 5).Sort Key1:=myC, _
Order1:=xlAscending, Orientation:=xlLeftToRight
Next myC
End Dub

HTH,
Bernie
MS Excel MVP



in message news:[email protected]...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top