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.
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)>=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.
"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
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.
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
>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
>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
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.
"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.
>
>
>
"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.
>
>
>
"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.
> >
> >
> >
"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.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks