# Sort Command - Custom Order Or Sort Ascending Or Descending

Oct 8, 2006

Is it possible to make excel sort ascending or descending but from mid way through alphabet and then loop through the alphabet again. for example. If Cell A1 had "A" in, it would sort as normal.

Cell A1 = A
Cell A2 = B
Cell A3 = C
Cell A4 = D
Cell A5 = E

If Cell A1 had "C" in, it would sort from "C" through the alphabet and then loop to the start of the alphabet as shown below.

Cell A1 = C
Cell A2 = D
Cell A3 = E
Cell A4 = A
Cell A5 = B

ADVERTISEMENT

## Rank & Sort Table: Unique Numbers Sort Ascending, But The Non-unique Numbers Sort Descending

Oct 5, 2007

I have a list in rows where I have a ranking formula =COUNT(\$G\$5:\$G\$81)-(RANK(G5,\$G\$5:\$G\$81)+ COUNTIF(\$G\$5:G5,G5)-1)+1 When I sort the rank, ascending. All of the unique numbers sort ascending, but the non-unique numbers sort descending

ex) 1.751
2.52
3.753
418
417
416

## Disable Sort Ascending/Descending

Apr 13, 2006

Is it possible to allow Autofilter but disallow Sort Ascending/ Descending for an excel list in sheet? I have data set up as an Excel List (Excel 2003, with Autofilter turned on) so all formulas, formatting etc copy down when a new row of data is added, however if I just Protect worksheet and disallow Sorting, the List features don't work. I also tried putting the following in the Worksheet Activate event

ActiveSheet.Protect AllowSorting:=False

But this doesn't seem to disable the Sort option in the Autofilter, only the Data Sort function.

## Toggle Sort Macro: Ascending/Descending

Jun 20, 2006

I would like to call a macro which would sort rows 4-23 from the highest to the lowest, or if it is already highest to lowest, then sort from lowest to highest. This is how I am doing the current sort(High-Low):-

Rows("4:23").Select
Selection.Sort Key1:= Range("E4"), Order1:=Range("e1").Value, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortTextAsNumbers
Range("A1").Select

## Sort Ascending/Descending Based On Criteria

Aug 2, 2006

I have an Overview worksheet that is pulling info from all other sheets in the workbook.

What I want to do is order that info in ascending order depending on the worksheet name.

So I want all the worksheet names that start with 'AB' say sorted in ascending order and all worksheets that start with 'BC' in ascending order.

Now this I have at present working by a macro I created which once the info is loaded onto the sheet I just selected the info and ordered it in ascending order. The thing is though the next time I enter this Overview sheet I might have an extra worksheet that starts with 'AB' and this will not be included in the order, I will have to adjust it everytime so I need a more automatic ordering process.

## Automatic Sort By Descending Order?

Mar 15, 2014

Don't know if macro is better, but I would like to try it with function

I have 2 sheets.

Sheet 1
Column A: Name
Column B: Points

Exemple:
Name Points
Mary 40
Johnny 20
Erick 60
Ralph 30

I want Sheet 2 to get data from Sheet 1 and sort by descending order automatically.

Then it should be

Sheet 2

Name Points
Erick 60
Mary 40
Ralph 30
Johnny 20

I don't want to do it manually every time I change some value; I want it to do automatically; so if I change, for example, Erick's points from 60 to 10 in Sheet 1, Erick should appear on the last place in Sheet 2, with his new value (10)

## Automatically Sort In Descending Order

Jun 17, 2009

I'm using a table with columns from A to F and an unlimited number of rows. Note that there is a title at the top of each column.
-I'd like my datas in column F to be automatically sorted in descending order from top to bottom when I hit the enter key or when the number is entered in last column (column F).
-the the entire row of data needs to be sorted according to the sorting criteria of column F ( datas entered need to stay on the same row)
-the macro should validate that the number value entered in column F is the same as the number value entered in column A. (to make sure that there was no typing mistake)
-Result in column D must be the difference between the corresponding value in column B and C (B-C=D)
*The next couple of constraints are not absolutely required, i'd like to have them only if it's possible to add constraints with filling color:
-Whenever there is no value entered in column C on a specific row I'd like the entire row to be colored in yellow (fill color)
-IF a number is entered in column C, and that the result of B-C in column D is not equal to zero, I'd like this specific row to be filled in Red.
-when all the values are entered in a row from column A to F and that the result of B minus C is equal to Zero in column D, i'd like this specific row to be filled in a green color.
***in other words, the datas in each rows from column A to F will be entered on 2 occasions; on the first time, only the datas in column A,B and F will be entered (so basically after entering this set of values the row should be filled in yellow. the second time, the remaining values will be added to the rows, so at this time A,B,C,D,E and F will all be entered. when this is done there will be two options
1-the value in column D is equal to Zero then the entire row should be filled in green or
2-the value in column D is'nt equal to zero, then this specific row should be filled in red.

Keep in mind that the datas of a row should be automatically sorted only when the value in column F is entered or when the enter key is hitted to add a new row.

## Sort Ascending Order

Feb 10, 2009

I need values from column F in ascending order.

Also I need in column G only the values without formula.

## How To Sort ListBox In Ascending Order

Jun 14, 2014

I have 2 listbox (List1 and List2). List2 get populated when the user select a value in List1 and based on the value selected in List1. My issues are:

1- Values in list2 are not sorted in ascending order especially when the list2 grows over 32.
2- When the user selects "None" in List1, it should clear List2 (onclick)

I worked on this code for a while with no luck trying to get it to work. Is that doable?

VB:

Option Explicit
Dim ufEventsDisabled As Boolean
Function SelectedString() As String
Const Delimiter As String = ","
Dim i As Long

[Code] .....

## Sort Numbers Into Ascending Order Across A Row

Nov 5, 2008

Im totally new to excel and have some data i need to sort. how to sort numbers into ascending order across a row. ie, I have 34 2 45 79 102 63 etc, and I need them to start low and order to high. i have over 1200 rows, so it would be good to do the whole sheet at the same time.

## Sort Ascending Order Not Working

Sep 25, 2012

In the below code, when I want to sort on Column "A" it is not working. Anything stand out that would prevent my code from working?

Sub Delete_Duplicates()Dim LastRow As LongWith Sheets("SAP Raw Extract")
LastRow = .Cells(Rows.Count, "A").End(xlUp).Row    'Create ID Column
.Columns("A:A").Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove        .Range("A1") = "ID"
.Range("A2").FormulaR1C1 = "=RC[5]&RC[6]&RC[32]"

[Code] .....

## Sort Combo Box By Ascending Order

Apr 4, 2007

I am trying to sort a combo box by ascending order...this combo box displays 2 columns of data which are populated from a spreadsheet. I would like to sort by the first column in the combo box which is numeric, but I do not want to sort the actual data on the spreadsheet.

## Sort A Column Of Data In Ascending Order

Sep 1, 2009

I am trying to sort a column of data in ascending order but I am not getting the results I expect. An example of the data held in the cells is:

4972-1A
4972-10A
4972-2A
4972-1B
4972-3C

When I sort it in ascending order it sorts like:
4972-10A
4972-1A
4972-1B
4972-2A
4972-3C......................

## Automaticcally Sort Data In Ascending Order

Apr 11, 2008

Need code for automaticcally sort data in ascending order any time there was a change in score. The names column is b1:43 and the corresponding score would be in column c1:43. I can't seem to do it.

## Excel 2007 :: Data Sort In Ascending Order

May 23, 2012

Excel 2007.

The first part of this code is fine and completes all the borders.
The second part is to the all the workbook by Data Sort in ascending order starting with

Column C
Then Q
Then column V

But also knowing to search to the last line. I think i might be close but not close enough for this to work.

Sub Macro2()
Dim LR As Long, i As Integer
Dim mysheet As Worksheet

Sheets("Test").Select
LR = Range("A" & Rows.Count).End(xlUp).Row
With Range("A9:AD" & LR)

[Code] .......

## VLookup Random Numbers - Sort Range In Descending Order And Return Relevant Value From Column

Aug 27, 2012

I have a column (B) of randomly generated numbers 1-14, and am using this formula range to sort in descending order and return the relevant value from column (c).

=VLOOKUP(LARGE(B3:B20,1),B3:C20,2,) to =VLOOKUP(LARGE(B3:B20,14),B3:C20,2,)

Works great, except when a number is duplicated, (E.G. 14,13,13,12,11,10,10,9,8 etc). It then returns the first value from(C) repeated, and not the value from the second and subsequent duplicated reference numbers.

## Custom Sort Order

Feb 13, 2007

I feel I've searched thoroughly and wasn't able to find the right answer. I've attached a daily report example that needs the "Product" field to be sorted in a particular order. The order should be JEX, Q3791J, YOO5, KLX9, GHT (all similar products need to be grouped together).

Since the report is run daily the number of rows changes daily: one day can have 50 entries and the next 10. Is there a way to dictate the sort order and insert a blank row between each product grouping?

Once the Products have been separated into their groups, how would I sort each grouping by the "Term" column?

## Create A Custom Sort Order

May 13, 2009

I am trying to create custom sort list. It works below when I define range as A1:A79.

Sub SortWS2()
Dim SortOrder As Variant
Dim sheetsorder As Range
Dim Ndx As Long
Application. ScreenUpdating = False
With Worksheets("Sort Order").Range("A1:A79")
For Ndx = .Cells.Count To 1 Step -1
Worksheets(.Cells(Ndx).Value).Move before:=Worksheets(1)
Next Ndx
End With
Application.ScreenUpdating = True
End Sub

I have created a dynamic range called sheetsorder. If I revise my code it does not work.

Sub SortWS2()................

## Sort By Specific Custom Order

May 23, 2008

I would like to sort my column A by "Urgent, High, Medium and Low". However, when I click on sort, it obviously sorts alphbetically. Need to code to sort all colums A:K.

## Excel 2010 :: Sorting Of Dates - Ascending Or Descending Order

Oct 25, 2011

Find the sorting method of dates in excel 2010. I have dates in one column and i want to sort it, but I am not able to sort in ascending or descending order.

## Custom Sort Change Month Order

Jul 10, 2014

Is it possible to do a custom sort on a column so that I can change the order the way the months are sorted. The order I'm looking for is:

October
November
December
January
February
March
April
May
June
July
August
September

Also the format for the cells in that column is 01-Jan, I don't want to see the year because I enter and sort the date as if the year doesn't matter so it automatically registers as 2014, if that makes sense. Basically I want that order of the months regardless of the year.

## Sort Worksheets Using Custom Sort To Choose Certain Word?

May 30, 2012

As of right now these are the steps i do to sort...i click custom sort choose My data has headers and then i select from the drop down list the word FRNAME.

is there any way i can setup a macro to do this for me? i tried recording the macro but it just is recording me choosing the column FRNAME is in. This does not work for me since FRNAME end up being in different columns all the time but will always be in row 1.

## Using Sort Descending In VBA

Jan 5, 2010

I have some sheets which I would like to loop through and use sort descending on column S, would somebody help me out with the code to do so? I actually have the looping code already, I just need the sort descending bit.

## VBA Sort By Headers Descending

Oct 18, 2012

I have numerical headers in each column that I am trying to sort in descending order (Most to Least) . I have about 9500 columns to sort. i am just looking to move the columns in a sort order not actually sort the data in the columns. Here is a sample below.

From this:

HTMLSheet3  ABCDEFGHIJKLMN
113648576535355315071349485476152746320913334742372721211628213677181341133173311312012040
114169400000200021040544100412070185414260509119080360310070020100401200118103446282223023310120122413

to this:

HTMLSheet2  ABCDEFGHIJKLMN115271364134913338576535355315074854764744632092773724127212116281361318133401016733
113121209114420040000200010518401441004127025463600105091198000371200102010401008101100243446282223233132012

## Sort Latest Data Descending For Dates

Oct 4, 2011

Based on the table below, I need two tasks.

1. Sort out the data descending for dates
2. Have a way so that I can only retrieve the latest information.

Meaning if I ask for Pen, I should only get a value of X

Similarly for XYZ, I should only get a value of N

Date A B Types
Value 5 Oct Pen X 5 Oct Pencil Y 5 Oct Pencil H 4 Oct Glue
Q 1 Oct
Pen N 27 Sep
Glue T 2 Sep
XYZ N 2 Sep
XYZ X

## Sort Ascending Button

Dec 12, 2009

I have never recorded a macro before and what I want, I think, is pretty simple but I can't figure it out. I want a sort button that sorts all information ascending by column B. See attached spreadsheet.

## Sort Ascending With Formula

Dec 20, 2008

For input I have in column A:

1
3
2
- (empty cell)
4

I want for output in column B:

1
2
3
4

Can I do something like this using a function?

## Sort - Not Ascending Or Decending

Oct 16, 2008

I have data in a spreadsheet with approximately 100 rows. In column F, the following values are allowed:
Subscription
Redemption
Transfer In
Transfer Out
Switch In
Switch Out

way to sort them in this order, rather than ascending or descending? (I want all of the Subscriptions together, then the Redemptions, and so on...)

## Sort Ascending For Variable Report Length

Feb 10, 2009

I'm trying to sort a report using case number in Ascending order, this report varies in length and data begins in cell B2 down the whole report. It needs to include the fields on either side ie. expand the selection.

## Formula To Sort Numbers In Ascending Value Into New Column?

Feb 14, 2003

I have three columns of values that are in no particular order that need to be sorted in ascending order in another column.

Copyrights 2005-15 www.BigResource.com, All rights reserved