Share via

How do I sort multiple rows at the same time?

Anonymous
2015-08-24T15:27:15+00:00

I have over 600 rows like this

I want to sort the rows so the yellow cells in each row appear in the same column.

The information in each cell can move between columns but needs to stay in the same row.

Is there a way to do this quickly through the whole data without doing one row at a time.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

4 answers

Sort by: Most helpful
  1. Anonymous
    2015-08-24T22:29:11+00:00

    I notice that all the yellow cells are negative numbers.

    This macro will sort rows left to right which puts all the negative numbers in column A.

    Sub Sort_Across_Columns()

    'Tom Ogilvy macro

    Dim r As Long

    Dim lrow As Long

    Dim lCol As Long

        Application.ScreenUpdating = False

        Application.Calculation = xlCalculationManual

        lrow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row

        lCol = ActiveSheet.Cells(ActiveCell.Row, _

        Columns.Count).End(xlToLeft).Column

        For r = 1 To lrow

            With Cells(r, 1).Resize(1, lCol)

                .Sort Key1:=Cells(r, 2), Order1:=xlAscending, _

                Header:=xlGuess, _

                Orientation:=xlLeftToRight, _

                DataOption1:=xlSortNormal

            End With

        Next r

        Application.ScreenUpdating = True

        Application.Calculation = xlCalculationAutomatic

    End Sub

    Gord

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2015-08-24T19:42:34+00:00

    and how many columns?

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2015-08-24T16:31:56+00:00

    Unless I am missing something... I have already tried that.

    The problem isn't how to arrange the cell. The problem is I have over 600 rows.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2015-08-24T15:43:41+00:00

    Hi,

    Try using Sort option under Data tab on the ribbon

    It will allow you to sort multiple columns at once. You won't need to sort columns multiple times or 1by1

    But in order to bring them in one column, you will have to do add another column and go manually

    Was this answer helpful?

    0 comments No comments