sorting rows

montecarlo2012

Well-known Member
Joined
Jan 26, 2011
Messages
984
Office Version
  1. 2010
Platform
  1. Windows
Hello, everyone. I have a list of NUMBERS B893:G1922 I want to sorting in ascending order from left to right. I already try the ribbon buttoms, and change one row and when I try the next row, the first change again. please any hand on this welcome. executable file would be appreciate.
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Hello from Lake Wales FL,

Can you explain a little bit more? Give some for mat of where your numbers start? What row? What column?
 
Upvote 0
hello from Orlando FL, well my NUMB3RS start at B1:G1922 in other words the first row is B1 C1 D1 E1 F1 G1 I think you must know when you say B1:G1922 asume is a sets of 6 number in every row they star column b and finish column g but take it as a row .
 
Upvote 0
Here's a macro that will do what you want.

Code:
Sub abcd()
 Dim Ptr As Long
 Dim TempSort As Long
 Dim NoExchanges As Integer
 ' Loop until no more "exchanges" are made.
For Ptr = 1 To 1922
    a = Range("B" & Ptr & ":G" & Ptr)
    Do
       NoExchanges = True
       ' Loop through each element in the array.
       For i = 1 To UBound(a, 2) - 1
           ' If the element is greater than the element
           ' following it, exchange the two elements.
           If a(1, i) > a(1, i + 1) Then
               NoExchanges = False
               TempSort = a(1, i)
               a(1, i) = a(1, i + 1)
               a(1, i + 1) = TempSort
            End If
        Next i
    Loop While Not (NoExchanges)
    Range("b" & Ptr).Resize(, UBound(a, 2)) = a
 Next Ptr
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,519
Messages
6,125,294
Members
449,218
Latest member
Excel Master

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top