Automatically arrange in Ascending order?

Andrew Hardscape

Board Regular
Joined
Sep 28, 2003
Messages
136
hello all,

sorry to sponge again!

Can anyone advise on how I can make the list of names automatically go into alphabetical order?

What I been doing is I highlight the list then I click on the SORT ASCENDING button.

But is there a way to make it do it by itself?
Sales Closure Tracking.xls
BCDE
2Sales Tracking
32006
4SALES DOLLARSJOB QUANTITIES
5TOTAL QUOTEDTOTAL JOB QUOTES
6$ 80,398.7611
7
8TOTAL SALESTOTAL SOLD
9$ 34,017.765
10
11TOTAL NOT SOLDTOTAL NOT SOLD
12$ 46,381.006
13
14CLOSURE RATECLOSURE RATE
1542%45%
16
17
18Job NameValueSale (Y/N)
19Aulrich$ 5,189.00N
20Barber, Bryan$ 12,570.00N
21Baughman$ 13,767.00Y
22Baughman (trees)$ 2,938.00N
23Biggs$ 3,329.00Y
24Blain$ 12,771.00N
25Brooks$ 4,864.00N
26Brown$ 8,049.00N
27Brulia$ 14,296.46Y
28Buckles$ 1,930.30Y
29Buckles$ 695.00Y
30
31
32
33
34
35
36
37
38
39
Sheet1
 

Some videos you may like

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Andrew Hardscape

Board Regular
Joined
Sep 28, 2003
Messages
136
I believe I do.

I'm by far no expert, but from what I do know, a Macro is the only way to accomplish this.
 

agihcam

Well-known Member
Joined
Jan 16, 2006
Messages
1,624
right click the sheet in question, view code then paste this code on the large white screen to the right.
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim i As Long
i = Range("a" & Rows.Count).End(xlUp).Row
If Target.Address <> "$A$18" Then Exit Sub
Range("A19:C" & i).Sort Key1:=Range("A19"), Order1:=xlAscending, Header:=xlNo, _
        OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End Sub

close the vbe by hitting x button or hit Alt + Q to return to the sheet.
the range will sort automatically as you double click the Job Name
 

Watch MrExcel Video

Forum statistics

Threads
1,113,915
Messages
5,545,016
Members
410,646
Latest member
LegenDSlayeR
Top