View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Is there a way to have a excel automatically alphabetize a sheet?

Here is an example. Enter this small macro into your worksheet code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Columns("A:A")) Is Nothing Then
Else
Application.EnableEvents = False
Columns("A:A").Select
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Application.EnableEvents = True
End If
End Sub

When data is entered in column A, the column will automatically re-sort
itself. You can modify the code to sort more than one column.

REMEMBER: Worksheet code.
--
Gary's Student


"Mzinsser" wrote:

My boss would like to create a spreadsheet that will automatically
alphabetize itself. Is this possible? He wants to be able to insert data
and instead of sorting it himself, if the program would do it. Please let me
know if there is a way!
Thank you!