Avalanchez
New Member
- Joined
- Jun 23, 2021
- Messages
- 14
- Office Version
- 365
- 2019
- 2016
- 2013
- 2011
- 2010
- 2007
- Platform
- Windows
Hello I have a work sheet that has columns A-AZ. Each of these columns has a header with a list of names under it. I want to add a name and have it automatically alphabetized and sorted when im done typing the new name.
I have been tryin this code:
Which seems to do the job just fine but when I try and set it up for each column it lags super hard and errors out.
How can I use or re write this code or similar to sort all of these columns?
I have been tryin this code:
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("B1", Range("B1").End(xlDown)).Sort Key1:=Range("B1"), Order1:=xlAscending, Header:=xlNo
End Sub
How can I use or re write this code or similar to sort all of these columns?