Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
AUTOSORTING
Can any1 help me with telling me a macro to autosort a list right after I
make a new entry in a new row or within the array |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
AUTOSORTING
Personally, I wouldn't sort my data after I made an entry. If I made a typo,
who knows where that row would go. But you can make sorting the data easier... In xl2003, you can apply data|filter|autofilter to the range and use the dropdown arrow to sort your data. Debra Dalgleish has a technique at her site that adds invisible rectangles in the headers and then sorts the data by that field when you click on one of those rectangles. http://contextures.com/xlSort02.html FARAZ QURESHI wrote: Can any1 help me with telling me a macro to autosort a list right after I make a new entry in a new row or within the array -- Dave Peterson |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
AUTOSORTING
I agree with Dave's opinion about not autosorting, but if you want to
proceed with despite his warnings, here's the code to do it. Put the following code in the worksheet module (right-click the worksheet tab that you want to sort) and paste in the following code. Change SORT_COLUMN to the column number that you will be enter data into. Change header:=xlGuess to either xlNo or xlYes, depending on whether your column has a header that should not be sorted. Private Sub Worksheet_Change(ByVal Target As Range) Const SORT_COLUMN = 1 '<<<< CHANGE AS NEEDED If Target.Columns.Count 1 Then Exit Sub End If If Target.Column = SORT_COLUMN Then Application.EnableEvents = False Me.UsedRange.Sort key1:=Me.Cells(1, SORT_COLUMN), order1:=xlAscending, _ header:=xlGuess Application.EnableEvents = True End If End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com (email address is on the web site) "FARAZ QURESHI" wrote in message ... Can any1 help me with telling me a macro to autosort a list right after I make a new entry in a new row or within the array |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need help autosorting information into different cells | Excel Discussion (Misc queries) | |||
Autosorting Information | Excel Worksheet Functions | |||
autosorting to a leaderboard | Excel Discussion (Misc queries) |