Ascending

F

Fareez

Dear All
I have sorted (ascending order)following numbers.
1
2
4
5
if i enter 3 below 5, is there any way to bring automatically 3 below 2
(ascending order)
thanks
 
L

L. Howard Kittle

Perhaps something like this in the sheet module will do what you want. From
the macro recorder with a small modification to relate it to column 1 only.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 1 Then Exit Sub
Columns("A:A").Select
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess,
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A1").Select
End Sub

HTH
Regards,
Howard
 
M

Ms-Exl-Learner

If you want to do it in the same cell then you have to go for a Macro
Solution, if you would like to use a helper column to do it, then use the
below method.

Assume that you are having the below Numbers in A Column

A Col
1
2
6
7
3
4
22
21

Paste this formula in B1 cell
=IF(ISERROR(SMALL(A:A,ROW(A1))),"END OF RESULT",SMALL(A:A,ROW(A1)))

Now copy the B1 cell formula and paste it to the remaining cells of B Column
Based on the A Column Data.

If you don’t want to show the Cell as Blank instead of the End of Result
Message use the below one.
=IF(ISERROR(SMALL(A:A,ROW(A1))),"",SMALL(A:A,ROW(A1)))

Remember to Click Yes, if this post helps!
 
G

Gord Dibben

I do not recommend auto-sorting upon entry.

Once your list gets longer, it is very difficult to find and fix any data
entry mistakes.

I like to confirm first that correct data has been entered then do the sort.


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top