How can I sort data automatically?

G

Guest

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.
 
G

Guest

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
 
R

RagDyeR

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!
=====================================================

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.
 
A

Aarani Devaraj

Hi I tried thie query and it worked perfect when I want to sort one table automatically in a worksheet. Please help with a code to sort 2 or more independent tables in a worksheet.



demechani wrote:

One play, adapted from a past posting by Andy BrownRight-click on the sheet
09-Apr-07

One play, adapted from a past posting by Andy Brow

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:=xlTopToBotto
End Su
'-------
Press Alt+Q to get back to Excel.
Test it out by typing numbers in A1 dow
--
Ma
Singapor
http://savefile.com/projects/23689
xdemechani
--
:

Previous Posts In This Thread:

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.

One play, adapted from a past posting by Andy BrownRight-click on the sheet
One play, adapted from a past posting by Andy Brow

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:=xlTopToBotto
End Su
'-------
Press Alt+Q to get back to Excel.
Test it out by typing numbers in A1 dow
--
Ma
Singapor
http://savefile.com/projects/23689
xdemechani
--
:

You won't be able to continue typing into the nextcolumn if the row jumps,
You won't be able to continue typing into the nex
column if the row jumps, would suggest you d
the sort when the worksheet is activate

Sorting triggered by an Event Macr
http://www.mvps.org/dmcritchie/excel/sorting.htm#activatg

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

also see additional comments i
http://www.mvps.org/dmcritchie/excel/event.htm#ws_activat

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


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

One approach is to use a formula in a "helper" column.
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

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

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 ge
automatically shifted in between 3 and 5 which is already type in the
screen.


Submitted via EggHeadCafe - Software Developer Portal of Choice
WPF Reflection Effect
http://www.eggheadcafe.com/tutorial...-beab-49bd76e20b9b/wpf-reflection-effect.aspx
 
D

Don Guillett

If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.
 

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