+ Reply to Thread
Results 1 to 12 of 12

Sort a column automatically

  1. #1
    Longtime
    Guest

    Sort a column automatically

    Is there a way to automatically sort a column in ascending order while
    entering numbers so that the column is sorted when last number is entered.
    Appreciate all help.

  2. #2
    Biff
    Guest

    Re: Sort a column automatically

    Hi!

    Why not just sort after the numbers have been entered?

    Using formulas and a helper column:

    Assume numbers are entered in column A

    Enter this formula in column B:

    =IF(COUNT(A:A)>=ROWS($1:1),SMALL(A:A,ROWS($1:1)),"")

    Copy down. If you expect to enter 10 numbers in column A then copy this
    formula down 10 rows.

    Biff

    "Longtime" <Longtime@discussions.microsoft.com> wrote in message
    news:013C09D8-53C2-460E-9979-F8649D440042@microsoft.com...
    > Is there a way to automatically sort a column in ascending order while
    > entering numbers so that the column is sorted when last number is entered.
    > Appreciate all help.




  3. #3
    Longtime
    Guest

    RE: Sort a column automatically



    "Longtime" wrote:

    > Is there a way to automatically sort a column in ascending order while
    > entering numbers so that the column is sorted when last number is entered.
    > Appreciate all help.

    Sorry, that did not do it

  4. #4
    Richard
    Guest

    RE: Sort a column automatically

    You might want to try this method using a command button. Substitute what you
    need!
    Private Sub CommandButton1_Click()
    Me.CommandButton1.Caption = "Sort" 'The CommandButton1 Properties Take
    FocusOnClick must be set to False
    Dim rng As Range, rng1 As Range
    With Worksheets("Sheet1")
    Set rng = .Range(.Cells(2, "A"), .Cells(Rows.Count, "A").End(xlUp))
    Set rng1 = .Cells(2, "A").End(xlToRight)
    Set rng = rng.Resize(, 3)
    rng.Sort _
    Key1:=.Range("A2"), _
    Order1:=xlAscending, _
    Header:=xlNo
    End With
    Application.OnTime Now + TimeSerial(0, 0, 2), _
    ThisWorkbook.Name & "!ResetCaption"
    CommandButton1.Caption = "Sorting..."
    End Sub

    "Longtime" wrote:

    > Is there a way to automatically sort a column in ascending order while
    > entering numbers so that the column is sorted when last number is entered.
    > Appreciate all help.


  5. #5
    Gary''s Student
    Guest

    RE: Sort a column automatically

    Hi Longtime:

    Here is a solution that's fun to play with:

    Say you are entering numbers in an arbitrary order in column A. You can
    enter them at the top of the column. You can enter them at the bottom of the
    column. You can leave spaces between entries. Doesn't matter. In B1 enter:

    =IF(ISERROR(LARGE(A:A,ROW())),"",LARGE(A:A,ROW()))
    and copy down

    Whatever you have entered in column A or whatever you will enter in column A
    will automatically appear in sorted order in column B.

    Column B will respond to changes in column A in an automatic fashion. It
    even catches ties.
    --
    Gary's Student


    "Longtime" wrote:

    >
    >
    > "Longtime" wrote:
    >
    > > Is there a way to automatically sort a column in ascending order while
    > > entering numbers so that the column is sorted when last number is entered.
    > > Appreciate all help.

    > Sorry, that did not do it


  6. #6
    Biff
    Guest

    Re: Sort a column automatically

    >Sorry, that did not do it

    Care to explain what that means?

    Biff

    "Longtime" <Longtime@discussions.microsoft.com> wrote in message
    news:37604D8C-207C-4E6F-9A87-582D38F79E6B@microsoft.com...
    >
    >
    > "Longtime" wrote:
    >
    >> Is there a way to automatically sort a column in ascending order while
    >> entering numbers so that the column is sorted when last number is
    >> entered.
    >> Appreciate all help.

    > Sorry, that did not do it




  7. #7
    Biff
    Guest

    Re: Sort a column automatically

    >sort a column in ascending order
    >=IF(ISERROR(LARGE(A:A,ROW())),"",LARGE(A:A,ROW()))


    You might want tho replace LARGE with SMALL.

    Biff

    "Gary''s Student" <GarysStudent@discussions.microsoft.com> wrote in message
    news:9A08B6F9-29B1-42F2-9DFD-B8A601505AAB@microsoft.com...
    > Hi Longtime:
    >
    > Here is a solution that's fun to play with:
    >
    > Say you are entering numbers in an arbitrary order in column A. You can
    > enter them at the top of the column. You can enter them at the bottom of
    > the
    > column. You can leave spaces between entries. Doesn't matter. In B1
    > enter:
    >
    > =IF(ISERROR(LARGE(A:A,ROW())),"",LARGE(A:A,ROW()))
    > and copy down
    >
    > Whatever you have entered in column A or whatever you will enter in column
    > A
    > will automatically appear in sorted order in column B.
    >
    > Column B will respond to changes in column A in an automatic fashion. It
    > even catches ties.
    > --
    > Gary's Student
    >
    >
    > "Longtime" wrote:
    >
    >>
    >>
    >> "Longtime" wrote:
    >>
    >> > Is there a way to automatically sort a column in ascending order while
    >> > entering numbers so that the column is sorted when last number is
    >> > entered.
    >> > Appreciate all help.

    >> Sorry, that did not do it




  8. #8
    Biff
    Guest

    Re: Sort a column automatically

    Why create a command button when you can just use the sort button on the
    formatting toolbar?

    Biff

    "Richard" <Richard@discussions.microsoft.com> wrote in message
    news:C7E58C33-3AF2-47A5-AC1B-BF980519D577@microsoft.com...
    > You might want to try this method using a command button. Substitute what
    > you
    > need!
    > Private Sub CommandButton1_Click()
    > Me.CommandButton1.Caption = "Sort" 'The CommandButton1 Properties Take
    > FocusOnClick must be set to False
    > Dim rng As Range, rng1 As Range
    > With Worksheets("Sheet1")
    > Set rng = .Range(.Cells(2, "A"), .Cells(Rows.Count, "A").End(xlUp))
    > Set rng1 = .Cells(2, "A").End(xlToRight)
    > Set rng = rng.Resize(, 3)
    > rng.Sort _
    > Key1:=.Range("A2"), _
    > Order1:=xlAscending, _
    > Header:=xlNo
    > End With
    > Application.OnTime Now + TimeSerial(0, 0, 2), _
    > ThisWorkbook.Name & "!ResetCaption"
    > CommandButton1.Caption = "Sorting..."
    > End Sub
    >
    > "Longtime" wrote:
    >
    >> Is there a way to automatically sort a column in ascending order while
    >> entering numbers so that the column is sorted when last number is
    >> entered.
    >> Appreciate all help.




  9. #9
    Longtime
    Guest

    Re: Sort a column automatically



    "Biff" wrote:

    > Why create a command button when you can just use the sort button on the
    > formatting toolbar?
    >
    > Biff
    >
    > "Richard" <Richard@discussions.microsoft.com> wrote in message
    > news:C7E58C33-3AF2-47A5-AC1B-BF980519D577@microsoft.com...
    > > You might want to try this method using a command button. Substitute what
    > > you
    > > need!
    > > Private Sub CommandButton1_Click()
    > > Me.CommandButton1.Caption = "Sort" 'The CommandButton1 Properties Take
    > > FocusOnClick must be set to False
    > > Dim rng As Range, rng1 As Range
    > > With Worksheets("Sheet1")
    > > Set rng = .Range(.Cells(2, "A"), .Cells(Rows.Count, "A").End(xlUp))
    > > Set rng1 = .Cells(2, "A").End(xlToRight)
    > > Set rng = rng.Resize(, 3)
    > > rng.Sort _
    > > Key1:=.Range("A2"), _
    > > Order1:=xlAscending, _
    > > Header:=xlNo
    > > End With
    > > Application.OnTime Now + TimeSerial(0, 0, 2), _
    > > ThisWorkbook.Name & "!ResetCaption"
    > > CommandButton1.Caption = "Sorting..."
    > > End Sub
    > >
    > > "Longtime" wrote:
    > >
    > >> Is there a way to automatically sort a column in ascending order while
    > >> entering numbers so that the column is sorted when last number is
    > >> entered.
    > >> Appreciate all help.

    >
    >
    >


  10. #10
    Longtime
    Guest

    Re: Sort a column automatically



    "Biff" wrote:

    > Why create a command button when you can just use the sort button on the
    > formatting toolbar?
    >
    > Biff
    >
    > "Richard" <Richard@discussions.microsoft.com> wrote in message
    > news:C7E58C33-3AF2-47A5-AC1B-BF980519D577@microsoft.com...
    > > You might want to try this method using a command button. Substitute what
    > > you
    > > need!
    > > Private Sub CommandButton1_Click()
    > > Me.CommandButton1.Caption = "Sort" 'The CommandButton1 Properties Take
    > > FocusOnClick must be set to False
    > > Dim rng As Range, rng1 As Range
    > > With Worksheets("Sheet1")
    > > Set rng = .Range(.Cells(2, "A"), .Cells(Rows.Count, "A").End(xlUp))
    > > Set rng1 = .Cells(2, "A").End(xlToRight)
    > > Set rng = rng.Resize(, 3)
    > > rng.Sort _
    > > Key1:=.Range("A2"), _
    > > Order1:=xlAscending, _
    > > Header:=xlNo
    > > End With
    > > Application.OnTime Now + TimeSerial(0, 0, 2), _
    > > ThisWorkbook.Name & "!ResetCaption"
    > > CommandButton1.Caption = "Sorting..."
    > > End Sub
    > >
    > > "Longtime" wrote:
    > >
    > >> Is there a way to automatically sort a column in ascending order while
    > >> entering numbers so that the column is sorted when last number is
    > >> entered.
    > >> Appreciate all help.

    >
    >
    >


  11. #11
    Longtime
    Guest

    Re: Sort a column automatically



    "Longtime" wrote:

    >
    >
    > "Biff" wrote:
    >
    > > Why create a command button when you can just use the sort button on the
    > > formatting toolbar?
    > >
    > > Biff
    > >
    > > "Richard" <Richard@discussions.microsoft.com> wrote in message
    > > news:C7E58C33-3AF2-47A5-AC1B-BF980519D577@microsoft.com...
    > > > You might want to try this method using a command button. Substitute what
    > > > you
    > > > need!
    > > > Private Sub CommandButton1_Click()
    > > > Me.CommandButton1.Caption = "Sort" 'The CommandButton1 Properties Take
    > > > FocusOnClick must be set to False
    > > > Dim rng As Range, rng1 As Range
    > > > With Worksheets("Sheet1")
    > > > Set rng = .Range(.Cells(2, "A"), .Cells(Rows.Count, "A").End(xlUp))
    > > > Set rng1 = .Cells(2, "A").End(xlToRight)
    > > > Set rng = rng.Resize(, 3)
    > > > rng.Sort _
    > > > Key1:=.Range("A2"), _
    > > > Order1:=xlAscending, _
    > > > Header:=xlNo
    > > > End With
    > > > Application.OnTime Now + TimeSerial(0, 0, 2), _
    > > > ThisWorkbook.Name & "!ResetCaption"
    > > > CommandButton1.Caption = "Sorting..."
    > > > End Sub
    > > >
    > > > "Longtime" wrote:
    > > >
    > > >> Is there a way to automatically sort a column in ascending order while
    > > >> entering numbers so that the column is sorted when last number is
    > > >> entered.
    > > >> Appreciate all help.

    > >
    > >
    > >


  12. #12
    Longtime
    Guest

    RE: Sort a column automatically



    "Richard" wrote:

    > You might want to try this method using a command button. Substitute what you
    > need!
    > Private Sub CommandButton1_Click()
    > Me.CommandButton1.Caption = "Sort" 'The CommandButton1 Properties Take
    > FocusOnClick must be set to False
    > Dim rng As Range, rng1 As Range
    > With Worksheets("Sheet1")
    > Set rng = .Range(.Cells(2, "A"), .Cells(Rows.Count, "A").End(xlUp))
    > Set rng1 = .Cells(2, "A").End(xlToRight)
    > Set rng = rng.Resize(, 3)
    > rng.Sort _
    > Key1:=.Range("A2"), _
    > Order1:=xlAscending, _
    > Header:=xlNo
    > End With
    > Application.OnTime Now + TimeSerial(0, 0, 2), _
    > ThisWorkbook.Name & "!ResetCaption"
    > CommandButton1.Caption = "Sorting..."
    > End Sub
    >
    > "Longtime" wrote:
    >
    > > Is there a way to automatically sort a column in ascending order while
    > > entering numbers so that the column is sorted when last number is entered.
    > > Appreciate all help.

    The column can always be sorted after the numbers have been entered. I was
    hoping I could get the numbers sorted without buttons, macros or manually i.e
    sorted as the numbers are entered. There is also a name attached to the
    number which should follow. There are no extra columns as it is a form.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1