View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
TanaMary TanaMary is offline
external usenet poster
 
Posts: 9
Default Automatically alphabetize excel worksheet

Where do I enter a string in the "worksheet code" to automatically
alphabetize my worksheet by the names in the A column. I have the string, I
just don't know how to access the 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