ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   How can I sort data automatically? (https://www.excelbanter.com/new-users-excel/138298-how-can-i-sort-data-automatically.html)

surekha

How can I sort data automatically?
 
I want data to be sorted automatically while typing on the screen?

for example I want number to come serialy if i type 4 it will get
automatically shifted in between 3 and 5 which is already type in the screen.

Max

How can I sort data automatically?
 
One play, adapted from a past posting by Andy Brown

Right-click on the sheet tab choose "View Code"
Then copy n paste this into the code window (white space)
'------
Private Sub Worksheet_Change(ByVal Target As Range)
Range("A:A").Sort Key1:=Range("A1"), Order1:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End Sub
'--------
Press Alt+Q to get back to Excel.
Test it out by typing numbers in A1 down
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"surekha" wrote:
I want data to be sorted automatically while typing on the screen?

for example I want number to come serialy if i type 4 it will get
automatically shifted in between 3 and 5 which is already type in the screen.


David McRitchie

How can I sort data automatically?
 
You won't be able to continue typing into the next
column if the row jumps, would suggest you do
the sort when the worksheet is activated

Sorting triggered by an Event Macro
http://www.mvps.org/dmcritchie/excel....htm#activatge

which includes an event macro for worksheet activation and
another event macro to activate at will with a doubleclick.

also see additional comments in
http://www.mvps.org/dmcritchie/excel...tm#ws_activate

---
HTH,
David McRitchie, Microsoft MVP - Excel
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Max" wrote ...
One play, adapted from a past posting by Andy Brown

Right-click on the sheet tab choose "View Code"
Then copy n paste this into the code window (white space)




David McRitchie

How can I sort data automatically?
 
correction for typo (#activate fragment-id was mistyped)
http://www.mvps.org/dmcritchie/excel...g.htm#activate



RagDyeR

How can I sort data automatically?
 
One approach is to use a formula in a "helper" column.

The helper column will sort itself, automatically, as numbers are entered
into the "main" column.

With numbers being entered in Column A,
Enter this formula in B1:

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

And copy down as needed.
--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===

"surekha" wrote in message
...
I want data to be sorted automatically while typing on the screen?

for example I want number to come serialy if i type 4 it will get
automatically shifted in between 3 and 5 which is already type in the
screen.




All times are GMT +1. The time now is 10:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com