Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Mike, that should all be one line of code. The automatic line wrap in the
news reader screwed it up. "Mike C" wrote: On Apr 13, 12:21 am, Per Jessen wrote: On 13 Apr., 07:04, Mike C wrote: Hello - I am wondering if anyone could provide me with code that will re-sort a list, each time a user places a new line at the bottom of the list. So, for example, in column A, rows 1-10, I have a list of names, which are sorted descending. When a new name is added to row 11, and the user clicks out off of the cell or presses enter, I am hoping the column can automatically resort. Thanks for any suggestions. Hi Mike Place the code below in the code sheet of the sheet containing your list. Private Sub Worksheet_Change(ByVal Target As Range) Set isect = Intersect(Target, Range("A:A")) If Not isect Is Nothing Then Range("A:A").Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom End If End Sub Regards, Per Thanks Jessen. For some reason, the section that reads: Range("A:A").Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom is giving me an error (i.e., turning red, reading "expression error") as soon as I paste it into the worksheet's module. Is this possibly because i have excel 2003? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
LIST ENTRY ENABLE DROP DOWN LIST TO ACCEPT MORE THAN 1 ENTRY | Excel Discussion (Misc queries) | |||
How to Create a list which sort itself automatically | Excel Worksheet Functions | |||
Automatically insert list entry | Excel Discussion (Misc queries) | |||
How do I sort a list automatically? | Excel Discussion (Misc queries) | |||
how do i automatically sort a list | Excel Worksheet Functions |