How do I format alphabetically in a column?

B

Brian k

I have a list of a hundred names last name first, etc. I have entered in a
spread sheet and I would like to format the first column to alphabatize when
a new entry is made, Possible??
Thanks
 
G

Gary''s Student

Try this worksheet event macro. It will automatically alphabetize column A
whenever an entry is entered or changed:

Private Sub Worksheet_Change(ByVal Target As Range)
Set r = Range("A:A")
If Intersect(r, Target) Is Nothing Then Exit Sub
Application.EnableEvents = False
Columns("A:A").Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess
Application.EnableEvents = True
End Sub
 

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