PDA

View Full Version : Solved: customize sort



danovkos
07-21-2009, 11:31 PM
Hi all,
pls. how can i sort data, that data which i define in code will be first and then will be the others.
F.e.
I mean. I want sort some names. I click somewhere in column with names. Then i run macro and it will sort it.
I want, that "john" will be on the beginning of data and then other names will be sorted ascending.

thx

Aussiebear
07-22-2009, 12:19 AM
What is meant to happen to those names that normally would precede "John"?

danovkos
07-22-2009, 12:55 AM
Everithing start after JOHN. So if there are data with name ADAM, this name starts after JOHN. Is important, that all data sort as usual, but JOHN will be first.

It will be seems like this

addr JOHN street city
addr2 JOHN street2 city2
addr3 JOHN street3 city3
addr4 ADAM street4 city4
addr5 ADAM street5 city5
addr6 BEN street6 city6
addr7 BEN street7 city7

And of course it will be more columns belong to this names (not only one column with name)
there will be somo adress and other ID data in rows.

Aussiebear
07-22-2009, 04:39 AM
As in John to Z then A to I, or just John then A to Z?

Simon Lloyd
07-22-2009, 04:45 AM
So really, you want the list always sorted A-Z (as when you click it will sort and remain that way) but any name you click to appear at the top of the list?

Is that correct?

danovkos
07-22-2009, 04:55 AM
yes, i want always have name, defined in code sorted in the top of table and rest of data want to sort A-Z. But of course i mean, that the table will include the name defined in code.
When i say it simply. It will be sort as basic function except name which will i write in code. This name will sort in top of table.

mikerickson
07-22-2009, 06:36 AM
Have you looked at Excel>Options>Custom Lists?
Data can be sorted by any of those custom lists or those that you define.

danovkos
07-22-2009, 06:54 AM
yes, custom lists helped
thx for your help..