Sorting data

S

sb

How do I format a column to automatically sort data alphabetically when new
data is added to the column?
 
N

Norman Jones

Hi SB,
How do I format a column to automatically sort data alphabetically when
new
data is added to the column?

It is certainly possible to write an event procedure to do this but I would
advise you not to!

What happens if you (or your users) are, like me, prone to the occasional
typing slip ? How would you conveniently or speedily find your (now neatly
sorted) incorrect data?

Set such problems against the minimal inconvenience of using the built-in
toolbar/menu sort options and I suspect that you will agree.

If not, post back!
 
D

Don Guillett

You could use a worksheet_change event in the sheet module code to do this.
But, do your really want to re-sort on EACH entry?
 
R

Ragdyer

These formulas could be placed in a "helper" column along side the actual
data column to return a sorted display of the data as it's entered.

Drag down to copy as needed.

For numbers *only*:

=SMALL($A$1:$A$100,ROW())

Compliments of Harlan:
Two Array formulas, which must be entered with CSE (<Ctrl> <Shift> <Enter>)
For text *OR* numbers *only*:

=INDEX($D$1:$D$10,MATCH(SMALL(COUNTIF($D$1:$D$10,"<"&$D$1:$D$10),ROW()-ROW($
E$1)+1),COUNTIF($D$1:$D$10,"<"&$D$1:$D$10),0))

For text *AND* numbers:

=INDEX($A$1:$A$10,MATCH(SMALL(COUNTIF($A$1:$A$10,"<"&$A$1:$A$10)+COUNT($A$1:
$A$10)*ISTEXT($A$1:$A$10),ROW()-ROW($B$1)+1),COUNTIF($A$1:$A$10,"<"&$A$1:$A$
10)+COUNT($A$1:$A$10)*ISTEXT($A$1:$A$10),0))
 
Top