close

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.

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)gt;=ROWS($1:1),SMALL(A:A,ROWS($1:1)),quot; quot;)

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

Biff

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


quot;Longtimequot; wrote:

gt; Is there a way to automatically sort a column in ascending order while
gt; entering numbers so that the column is sorted when last number is entered.
gt; Appreciate all help.
Sorry, that did not do it

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

quot;Longtimequot; wrote:

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

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())),quot;quot;,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 Studentquot;Longtimequot; wrote:

gt;
gt;
gt; quot;Longtimequot; wrote:
gt;
gt; gt; Is there a way to automatically sort a column in ascending order while
gt; gt; entering numbers so that the column is sorted when last number is entered.
gt; gt; Appreciate all help.
gt; Sorry, that did not do it

gt;Sorry, that did not do it

Care to explain what that means?

Biff

quot;Longtimequot; gt; wrote in message
...
gt;
gt;
gt; quot;Longtimequot; wrote:
gt;
gt;gt; Is there a way to automatically sort a column in ascending order while
gt;gt; entering numbers so that the column is sorted when last number is
gt;gt; entered.
gt;gt; Appreciate all help.
gt; Sorry, that did not do it
gt;sort a column in ascending order
gt;=IF(ISERROR(LARGE(A:A,ROW())),quot;quot;,LARGE(A:A,ROW()) )

You might want tho replace LARGE with SMALL.

Biff

quot;Gary''s Studentquot; gt; wrote in message
...
gt; Hi Longtime:
gt;
gt; Here is a solution that's fun to play with:
gt;
gt; Say you are entering numbers in an arbitrary order in column A. You can
gt; enter them at the top of the column. You can enter them at the bottom of
gt; the
gt; column. You can leave spaces between entries. Doesn't matter. In B1
gt; enter:
gt;
gt; =IF(ISERROR(LARGE(A:A,ROW())),quot;quot;,LARGE(A:A,ROW()))
gt; and copy down
gt;
gt; Whatever you have entered in column A or whatever you will enter in column
gt; A
gt; will automatically appear in sorted order in column B.
gt;
gt; Column B will respond to changes in column A in an automatic fashion. It
gt; even catches ties.
gt; --
gt; Gary's Student
gt;
gt;
gt; quot;Longtimequot; wrote:
gt;
gt;gt;
gt;gt;
gt;gt; quot;Longtimequot; wrote:
gt;gt;
gt;gt; gt; Is there a way to automatically sort a column in ascending order while
gt;gt; gt; entering numbers so that the column is sorted when last number is
gt;gt; gt; entered.
gt;gt; gt; Appreciate all help.
gt;gt; Sorry, that did not do it
Why create a command button when you can just use the sort button on the
formatting toolbar?

Biff

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


quot;Biffquot; wrote:

gt; Why create a command button when you can just use the sort button on the
gt; formatting toolbar?
gt;
gt; Biff
gt;
gt; quot;Richardquot; gt; wrote in message
gt; ...
gt; gt; You might want to try this method using a command button. Substitute what
gt; gt; you
gt; gt; need!
gt; gt; Private Sub CommandButton1_Click()
gt; gt; Me.CommandButton1.Caption = quot;Sortquot; 'The CommandButton1 Properties Take
gt; gt; FocusOnClick must be set to False
gt; gt; Dim rng As Range, rng1 As Range
gt; gt; With Worksheets(quot;Sheet1quot;)
gt; gt; Set rng = .Range(.Cells(2, quot;Aquot;), .Cells(Rows.Count, quot;Aquot;).End(xlUp))
gt; gt; Set rng1 = .Cells(2, quot;Aquot;).End(xlToRight)
gt; gt; Set rng = rng.Resize(, 3)
gt; gt; rng.Sort _
gt; gt; Key1:=.Range(quot;A2quot;), _
gt; gt; Order1:=xlAscending, _
gt; gt; Header:=xlNo
gt; gt; End With
gt; gt; Application.OnTime Now TimeSerial(0, 0, 2), _
gt; gt; ThisWorkbook.Name amp; quot;!ResetCaptionquot;
gt; gt; CommandButton1.Caption = quot;Sorting...quot;
gt; gt; End Sub
gt; gt;
gt; gt; quot;Longtimequot; wrote:
gt; gt;
gt; gt;gt; Is there a way to automatically sort a column in ascending order while
gt; gt;gt; entering numbers so that the column is sorted when last number is
gt; gt;gt; entered.
gt; gt;gt; Appreciate all help.
gt;
gt;
gt;



quot;Biffquot; wrote:

gt; Why create a command button when you can just use the sort button on the
gt; formatting toolbar?
gt;
gt; Biff
gt;
gt; quot;Richardquot; gt; wrote in message
gt; ...
gt; gt; You might want to try this method using a command button. Substitute what
gt; gt; you
gt; gt; need!
gt; gt; Private Sub CommandButton1_Click()
gt; gt; Me.CommandButton1.Caption = quot;Sortquot; 'The CommandButton1 Properties Take
gt; gt; FocusOnClick must be set to False
gt; gt; Dim rng As Range, rng1 As Range
gt; gt; With Worksheets(quot;Sheet1quot;)
gt; gt; Set rng = .Range(.Cells(2, quot;Aquot;), .Cells(Rows.Count, quot;Aquot;).End(xlUp))
gt; gt; Set rng1 = .Cells(2, quot;Aquot;).End(xlToRight)
gt; gt; Set rng = rng.Resize(, 3)
gt; gt; rng.Sort _
gt; gt; Key1:=.Range(quot;A2quot;), _
gt; gt; Order1:=xlAscending, _
gt; gt; Header:=xlNo
gt; gt; End With
gt; gt; Application.OnTime Now TimeSerial(0, 0, 2), _
gt; gt; ThisWorkbook.Name amp; quot;!ResetCaptionquot;
gt; gt; CommandButton1.Caption = quot;Sorting...quot;
gt; gt; End Sub
gt; gt;
gt; gt; quot;Longtimequot; wrote:
gt; gt;
gt; gt;gt; Is there a way to automatically sort a column in ascending order while
gt; gt;gt; entering numbers so that the column is sorted when last number is
gt; gt;gt; entered.
gt; gt;gt; Appreciate all help.
gt;
gt;
gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()