Actually,I want to sort my attach file of column K in descending order and alongwith column B in ascending order.
Will it be thru VBA codes? Any help highly welcome.
Please see the result as next sheet i.e.'Result Display'.
Sorting a column datas
-
- Lounger
- Posts: 26
- Joined: 20 Jan 2014, 11:18
- Location: nepal
Sorting a column datas
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 78531
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Sorting a column datas
You can do this in the interface:
On the Home tab of the ribbon, click Sort & Filter | Custom Sort...
Select 'Chk. digit' from the Column dropdown, and select 'Largest to Smallest' from the Order dropdown.
Click Add Level to add a second sort level.
Select 'Vendor' from the Column dropdown, and select Smallest to Largest' from the Order dropdown.
Click OK.
If you prefer a macro:
On the Home tab of the ribbon, click Sort & Filter | Custom Sort...
Select 'Chk. digit' from the Column dropdown, and select 'Largest to Smallest' from the Order dropdown.
Click Add Level to add a second sort level.
Select 'Vendor' from the Column dropdown, and select Smallest to Largest' from the Order dropdown.
Click OK.
If you prefer a macro:
Code: Select all
Sub SortList()
Range("B5").CurrentRegion.Sort Key1:=Range("K5"), Order1:=xlDescending, _
Key2:=Range("B5"), Order2:=xlAscending, Header:=xlYes
End Sub
Best wishes,
Hans
Hans
-
- Lounger
- Posts: 26
- Joined: 20 Jan 2014, 11:18
- Location: nepal
Re: Sorting a column datas
Actually,I am learning both excel and VBA codes at the same time.You have suggested me both answers. Thanks Hans for your quick response and steps wise guidances.