Setting a spreadsheet to auto sort data entry

J

Judy Rose

Have a spreadsheet that is created each month to track the reappointment
applications for that month, there are 16 various stages the application
could be in and the number 1-16 is entered into column A. I want to be able
to set up the spreadsheet to auto sort based on the entry in Column A upon
update of the value.

Each case starts at 1, depending on its progress through the review process
would dictate the number value beyond 1, each time I update the record to
show progress I want my spreadsheet to automatically resort the rows of data
based on the updated value.

Is this possible.
 
G

Gary''s Student

Say your data is in columns A & B. Whenever you update a record in column A
(manually), we want column A & B to re-sort automatically. Assume there is a
header row in row #1. Enter the following event code in the worksheet code
area:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Range("A:A"), Target) Is Nothing Then Exit Sub
n = Cells(Rows.Count, "A").End(xlUp).Row
Application.EnableEvents = False
Range("A1:B" & n).Sort Key1:=Range("A2"), Order1:=xlAscending,
Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Application.EnableEvents = True
End Sub

Naturally, enter data in column B before column A.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top