Share via

Left to right sorting

Anonymous
2016-01-08T18:02:02+00:00

Hi.

I'm wondering whether it is possible to do the following using Microsoft Excel and if so, does anyone have any useful tips,  methods or formulas to do so: Is it possible to alphabetically left-to-right sort multiple rows of data? 

I know how to use the left-to-right function however my data set is over 5000 rows deep and therefore individually sorting lines is unfortunately not an option.

If you're able to help it would be much appreciated.

Kind regards

Darren

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

5 answers

Sort by: Most helpful
  1. Vijay A. Verma 104.9K Reputation points Volunteer Moderator
    2016-01-09T11:42:24+00:00

    Please post screenshot of few lines of data and result expected. That would help us to give you right macro to do the job,

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2016-01-08T21:04:58+00:00

    Thank you for the fast replies, however I'm not entirely sure that methods suggested by Ketul and Tasos would work in my instance.

    I am looking to sort each value as a quick and easy means to eliminate all values in the row other than the lowest alphabetically. i.e. my data set is formatted in the form of patents which follow a country abbreviation preceded by a date and series of numbers, for example US201600000 - I want to sort the patent in each row with the earliest date to the left, with newer papers falling to the right. Forgive me if I'm wrong but as far as I understand pivot tables to work they only filter the data present rather than sort it in a manner to allow such elimination.

    Gord, I apply the macro you have suggested.

    Kindest regards to everyone

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2016-01-08T20:00:57+00:00

    Hi,

    you can do it, using a vba macro

    sample:

    data in range A1:E20

    pic1, before

    pic2, after

    is that you want ?

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2016-01-08T20:00:41+00:00

    Macro to sort left to right on multiple rows.

    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
  5. Anonymous
    2016-01-08T18:53:53+00:00

    I would recommend using PivotTables.

    There are lots of tutorials online on how to use it. It's a great tool to solve your sorting questions. 

    https://support.office.com/en-us/article/Overview-of-PivotTable-and-PivotChart-reports-00a5bf71-65cb-49f9-b321-85bb7b0b06c2

    Was this answer helpful?

    0 comments No comments