Discussion Locked

Sorting items in Excel 2000

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi

I would like to know if it is possible to permanently sort a column in Excel 2000.

For example, I have a list of names which I can sort alphabetically. What I would like to happen is if someone added a name to the end of the list, Excel could automatically sort it so the new name would appear in the correct alphabetical position.

Can anyone help with this please?

4 replies

by dklippert

Here's a quick solution.
Write a macro

Sub DoSort()
Columns("A:A").Select
Selection.Sort Key1:=Range("A1"), _ Order1:xlAscending, Header:=xlGuess
Range("A1").Select
End Sub

Right click the sheet tab and choose View Code.
Change the selection at the top from (General to Worksheet. On the right choose Change.

The code should read:

Private Sub Worksheet_Change(ByVal Target As Range)
DoSort
End Sub

by dklippert

Selection.Sort Key1:=Range("A1"), Order1:xlAscending, Header:=xlGuess

This can be one line

This discussion is closed to new replies.