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