I have a worksheet (wsA) acting as a database with columns ID, Name and Amount.
I defined a name for each of these of columns.
On the other worksheet (wsB), I made a drop-down list for each of these
names using Data-gt;Validation.
However, the items in the drop-down list is not sorted because my data in
wsA is not sorted and I don't want to sort it manually everytime I add a
record to wsA. I want it to be sorted because this is easier for user to
search for a particular record.
Is there a way to sort the items in the drop-down lists without using Macro?
If no, marco is fine too.
Thanks.
Hi Daniel,
You would need a macro, but you could use a low maintenance macro
that sorts the list upon deactivation of the worksheet that the defined name
actually refers to. I would not suggest sorting upon change as the flipping
around of cells would confuse you.
www.mvps.org/dmcritchie/excel/event.htm
No specific macro for Private Sub Worksheet_Deactivate()
but you can use the example in
www.mvps.org/dmcritchie/excel...g.htm#activate
to give you an idea, or perhaps it as is..
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: www.mvps.org/dmcritchie/excel/excel.htm
Search Page: www.mvps.org/dmcritchie/excel/search.htm
quot;Danielquot; gt; wrote in message ...
gt; I have a worksheet (wsA) acting as a database with columns ID, Name and Amount.
gt;
gt; I defined a name for each of these of columns.
gt;
gt; On the other worksheet (wsB), I made a drop-down list for each of these
gt; names using Data-gt;Validation.
gt;
gt; However, the items in the drop-down list is not sorted because my data in
gt; wsA is not sorted and I don't want to sort it manually everytime I add a
gt; record to wsA. I want it to be sorted because this is easier for user to
gt; search for a particular record.
gt;
gt; Is there a way to sort the items in the drop-down lists without using Macro?
gt; If no, marco is fine too.
gt;
gt; Thanks.
- Nov 18 Sat 2006 20:10
How to sort a drop-down list?
close
全站熱搜
留言列表
發表留言