ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   alphabetizing automatically from a list (https://www.excelbanter.com/excel-discussion-misc-queries/123327-alphabetizing-automatically-list.html)

mbawct

alphabetizing automatically from a list
 
I have a list of names that i want to be able to add to and keep at its
current location, but I need it to alphabetize the list automatically. I
certainly know how to do this "manually," but I have multiple lists that need
to be reordered.

To make matters worse, I really actually need the alphabetized list to be in
a new sheet, outside the original workbook.

Thank you for your help!

Gary''s Student

alphabetizing automatically from a list
 
This is just a sample. Put the following code in worksheet code for the
sheet with the list:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("E1")) Is Nothing Then
Exit Sub
End If

Application.EnableEvents = False
Columns("E:E").Sort Key1:=Range("E1")
Range("E1").Insert Shift:=xlDown
Range("E1").Select
Application.EnableEvents = True
End Sub

Put the list from E2 on down. Leave E1 blank until you are ready.

When you enter something in E1, the list will automatically re-sort itself
and leave a space in E1 for more entries.

If you need help with VBA, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm
and
http://www.cpearson.com/excel/events.htm
--
Gary's Student


"mbawct" wrote:

I have a list of names that i want to be able to add to and keep at its
current location, but I need it to alphabetize the list automatically. I
certainly know how to do this "manually," but I have multiple lists that need
to be reordered.

To make matters worse, I really actually need the alphabetized list to be in
a new sheet, outside the original workbook.

Thank you for your help!



All times are GMT +1. The time now is 03:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com