Alphabetize drop down list

KDS14589

Board Regular
Joined
Jan 10, 2019
Messages
205
Office Version
  1. 2016
Platform
  1. Windows
I've used MrExcel's Trick #916 to remove blanks from my listbut now I want the results to be alphabetized without rearranging the primarylist after each time I add data, the data is all single text and no numbers.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
.
Lets say you have your list in Col K ...

If you place this macro in the Sheet Module, it will auto-sort anything that is entered into Column K, Alphabetically from A - Z.

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next




    If Not Intersect(Target, Range("K:K")) Is Nothing Then
        Range("K1").Sort Key1:=Range("K1"), _
        Order1:=xlAscending, Header:=xlYes, _
        OrderCustom:=1, MatchCase:=False, _
        Orientation:=xlTopToBottom
        Application.DisplayAlerts = True
    End If
End Sub
 
Upvote 0
.
Lets say you have your list in Col K ...

If you place this macro in the Sheet Module, it will auto-sort anything that is entered into Column K, Alphabetically from A - Z.

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next




    If Not Intersect(Target, Range("K:K")) Is Nothing Then
        Range("K1").Sort Key1:=Range("K1"), _
        Order1:=xlAscending, Header:=xlYes, _
        OrderCustom:=1, MatchCase:=False, _
        Orientation:=xlTopToBottom
        Application.DisplayAlerts = True
    End If
End Sub
I may have been wrong when I said ‘YES’ because I can’t get the macro in the Sheet Module to work.
The data is from a formula I used from ‘MrExcel Trick #916 to remove blanks. FYI the final data I’m using is in column I
 
Upvote 0
I may have been wrong when I said ‘YES’ because I can’t get the macro in the Sheet Module to work.
The data is from a formula I used from ‘MrExcel Trick #916' to remove blanks. FYI the final data I’m using is in column I.
I'm trying to get my final result to be alphabetized.

 
Upvote 0

Forum statistics

Threads
1,226,695
Messages
6,192,478
Members
453,727
Latest member
tuong_ng89

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top