View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Automatically Sort Alphabetically

Chris,

Right click your sheet tab, view code and paste the code below in. On
entering data in column C you will be asked if your want to sort. If Yes then
columns A - F will be sorted on column C

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("C:C")) Is Nothing Then
response = MsgBox("Do you want to sort", vbYesNo)
If response = vbNo Then Exit Sub
Lastrow = Cells(Rows.Count, "C").End(xlUp).Row
Range("A1:F" & Lastrow).Sort Key1:=Range("C1"), Order1:=xlAscending
End If
End Sub

Mike

"Chris" wrote:

Hi All,

I have a spreadsheet with 6 columns of data.
In column "C" contains the name of the person, A, B, D, E, and F contain
other information.

I would like to keep the users name in column C.

Is it possible to set somthing up where at the end of the spreadsheet if I
add a new entry that it will automatically place that person alphabetically?

Any helps would be great.
Thanks,

Chris