Sort - Defined Sort Criteria
Sep 20, 2006
I have an Overview sheet within my workbook that contains info from all other sheets.
What I want to do is when you click on the Sort button in the General sheet it will activate the Overview Sheet and
- first off sort all sheets starting with AJ together, then all sheets starting with CJ together and then all sheets starting with PJ
- then the next thing i want it to do is sort all Ajs by their start dates, sort all CJs by their start dates and the same for all PJs.
Now up until now I was keeping all sheets that began with AJs together in the workbook and so on so I was able to use the following sort function
Sub Overview_sorting() ...
View 5 Replies
ADVERTISEMENT
Aug 29, 2006
I get a run time error 1004 when I run this sort.
ActiveSheet. Range("A1:AC277").Sort Key1:=ActiveSheet.Range("G2"), Order1:=xlAscending, Key2:= _
ActiveSheet.Range("E2"), Order2:=xlAscending, header:=xlYes, OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, _
DataOption2:=xlSortNormal
View 9 Replies
View Related
Jun 16, 2013
I have three columns in Excel
Column state "5K", Column B state number in text format, Column C state text.
I would like to auto extract the number in below sequence by sorting "Column B" to Column D format.
How to do it?
Text
Text
Text
Column D
5K
01
B
5K01B-5K03B
[Code] .........
View 1 Replies
View Related
Dec 13, 2012
Essentially i get a Runtime 5 error on the bold bit of code....
I am trying to define a range .... by using thexlUp function find the last row ( which works ) i then pass this variable into the sort code and get the error its probably very simple to fix, all it does i sort columnA but finds the last cell .... instead of the whole column,,,,
Sub Macro7()
'
' Macro7 Macro
'
' Keyboard Shortcut: Ctrl+e
NumberOfRow = Sheets("Sheet1").Range("A3000").End(xlUp).Row
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=Sheets("Sheet1").Range("A2", Cells(NumberOfRow)), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
[Code] .......
View 2 Replies
View Related
May 14, 2007
I want to do is sort in ascending sequence, a range defined as rTrainRow which is a row of text data. Each cell in the row can contain space, blank, one Alphabetic character or a special character such as $, %, (, +, etc.
View 2 Replies
View Related
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
View 5 Replies
View Related
Jan 13, 2014
Using DataEntry sheet for data.
Trying to rearrange the data to DataFormatedProperly sheet.
So far all I can accomplish is DataFormatedWrong sheet.
Edit: Not sure what happened but file was NOT understandable before. It should be correct now.
View 2 Replies
View Related
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
View 4 Replies
View Related
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.
View 1 Replies
View Related
Nov 26, 2008
I would like to ask if it is possible to sort a range of row? What I mean is, if I sort like Row 1, the entire block of row 1 will move as well? Like if i have column A to F, then row 1 of column A to F will move together at the same time.
View 3 Replies
View Related
Nov 5, 2009
I am looking for a macro to sort my colums in ascending order the range i need sorted is from A7:F107, it will be sorted with the numbers in the A column ie 1 - 107. sometimes different numbers get added and it has to be sorted in number sequence.
If possible i would also like a macro to protect this range after the sort,
View 3 Replies
View Related
Jul 23, 2014
I have a list of people that I want to sort according to their age in ascending order. If several people have the same last name (family members), I want those to be sorted together. After clicking on the SORT-button the result should look like this:
[Code] ...
Attached File : Test2.xlsm
View 13 Replies
View Related
Feb 17, 2010
I have multiple employees working on different projects. I would like to use a formula or some kind of macro where I can automatically scan an entire worksheet and manipulate the data to show me how much time was spent by each employee on each project. Using the SUMIF command only lets me use one criteria. In my case I need to sum if in the row there is a match with the employee name and the project name.
For example, if Employee A is working on Project 1 then sum the units. I would like everything summarized in a nice table. Attached is a basic example of my sheet.
View 3 Replies
View Related
Nov 28, 2006
I was wondering if there is a workaround for sorting in Excel by MORE THEN 3 CRITERIA?
I have seen a couple of solution doing 2 seperate sorts but was wondering if you can write code to expand on Excels limited sorting capabilities?
View 9 Replies
View Related
Apr 3, 2008
Im sorting a dynamic range as mentioned in this Sorting a Named Range. My range is called drWarningTypes and is defined as:
=OFFSET(DataSource!$A$2,0,0, COUNTA(DataSource!$A:$A)-1,1)
When there is only one cell in the range, then running the following sort function includes A1 also in the search (and also adjoining columns).....
View 9 Replies
View Related
Apr 16, 2013
I have a list of 562 records. In order to generate a targeted mailing list, I would like to display) only those records meeting the criteria:
=SUMPRODUCT(--(M2:M562>0),--(U2:U562>0)) .
View 9 Replies
View Related
Dec 30, 2006
I am trying to sort a long range of text that is placed horizontally in a spreadsheet. I can do it vertically with the sort function in Excel but it does not seem to work for text that is placed horizontally. Example is as below:
Inventory Accounts Human Resources
View 2 Replies
View Related
May 18, 2009
How can I sort an array of data based on the selection from a drop-down menu? And can it be 'secondary' sorted with the result from a second drop-down (ascending or descending is unimportant)?
View 2 Replies
View Related
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.
View 9 Replies
View Related
Aug 18, 2014
Have a sheet with list of strings in C:C
Examples of string:
RIO AU 082814 45
RIOE AU 102815 45.01
etc...these are the two primary types
Wish to reorder row 6 onwards according to the following hierarchy:
1st order: year number ascending (ie the last 2 digits of the 6 digit mid: 14, 15 in our example)
2nd order: month number ascending (ie the first 2 digits of the 6 digit mid: 08, 10 in our example)
3rd order: strike value ascending (ie the number on far right: 45, 45.01 in our example)
sortMacro.xlsx
View 3 Replies
View Related
Sep 9, 2012
I have following data to sort/filter
Sector
Flt no
origin
[Code]...
Is this possible with excel functions?
View 1 Replies
View Related
May 1, 2013
I have two sets of data:
Data set #1
Indicator PriceIndicator Price Date
2.1 10/27/08
2.11 10/22/08
2.17 11/21/08
2.38 03/20/09
2.38 03/25/09
2.46 03/19/09
2.5 03/09/09
2.5 03/24/09
2.53 12/04/08
2.73 12/09/08
2.82 12/24/08
2.83 12/18/08
2.89 12/12/08
2.9 03/13/09
Data set #2:
Close Price Close Price Date s1s2s3s4r1r2r3r4
2.25 12/11/09
2.30 12/12/09
2.40 12/13/09
2.00 12/14/09
2.12 12/15/09
2.50 12/16/09
2.51 12/17/09
2.53 12/18/09
2.49 12/19/09
What I'm attempting to do is find what are the CLOSEST four indicator prices in data set #1 are above (r1, r2, r3, r4) and below (s1, s2, s3, s4) the closing price in data set #2. Also, I can only use the indicator numbers in data set #1 that are on or before the close price date in data set #2. Because of this, not all of the r's and s's will be filled in.
I would like to use just regular excel formulas, but I have a feeling that VBA may be my only option.
View 3 Replies
View Related
Sep 27, 2008
I have a spreadsheet with multiple columns. The first column defines a "route", and the next two list "start" and "end" cities for that route. The fourth column lists the length of each route. There are only a limited number of cities, so the same entries appear in both "start" and "end" several times. I would like to use Autofilter to sort the list for every appearance of a given entry in either "start" or "end". Is there a way to make Autofilter sort mutiple columns simultaneously?
I could achieve the desired end result with Advanced Filter, but I want something with the ease-of-use and immediate update/response of Autofilter. Advanced Filter requires explanation (as well as lots of clicking and typing) whereas Autofilter is self-evident. I also want to avoid VBA Macros as they are not well-understood by the users who will use this spreadsheet (and any VBA Macro will require very specific input to work properly.) Is it possible to do what I want? Or is Advanced Filter / VBA the only way to do it?
View 2 Replies
View Related
Apr 18, 2014
I have this massive spreadsheet, with the maximum rows excel will fit on one sheet. In the interest of simplicity, this is what the raw data looks like:
Last First Amount
Jones Jim $1000
Jung Joe $700
White Jon $100
Jones Jim $200
Jones Jan $300
Jung Joe $800
White Jon $200
What I want to do is automatically get excel to group all the same names together. Then I want it to sum all the values for each name, then order by largest total value for each person, then order that by name alphabetically. In other words, the above would look like this after the sort:
Last First Amount
Jung Joe $800
Jung Joe $700
Jones Jim $1000
Jones Jim $200
Jones Jan $300
White Jon $200
White Jon $100
Or, if necessary, there could be sum total rows under each name...although I don't have spare rows, so IDK. I could delete some rows if I had to, but would rather not.
View 1 Replies
View Related
Apr 15, 2008
I have spent a few days searching through forums but cannot find examples that i have been able to successfully adapt ( because they are to complicated for my limited knowledge). I have a workbook with 5 sheets, sheet1 (current), and sheet 4 (archive) are the important ones. I need a macro to
A) copy rows from "current" to "archive" ( to the 1st empty row) if column S of "current" contains "Closed" ( the word is generated by formula).
B) The paste needs to paste special values and number formats ( want to lose formula but not conditional formatting).
C) data sort "archives" based on col A - this puts the newly archived data into correct sequence.Data sort lowest number 1st
D) delete the copied rows from "current".
e) give me a count of how many rows it deleted, (I have a macro to insert rows so will run that manually to recreate the correct number of emtpy rows (with formula and formatting) to bring the current sheet back to usual size.
I tried modifying a macro by RPaulson (based on cells on one sheet to cells on another), to work with entire rows but couldn't get it to work.
Found that paste special uses PasteSpecial xlPasteValues, but , and thats about it.
View 6 Replies
View Related
May 6, 2014
I have a set of data (assume 2 columns, one with a long name and the second with a time). The names contain variables that must be used as criteria (a single entry may contain "Blue" and "On"/"Off") and times vary, based on when the Name turns "On" or "Off" [in minutes: 25 (On), 47 (Off), 89 (On), 100 (Off) and 137 (On)]. I need to create another table that automatically inserts values for all times, to include the missing times (0 min thru 24 and 26 thru 46, etc.). EX: If the first entry is "Blue-On" at "25 minutes", the cells from 0 minutes to 24 minutes are each "0" and become a "1" at 25 minutes - the following cells are "1" until 47 minutes (where it is turned off). (1 and 0 represent "On" and "Off", respectively)
How can I created a formula to insert the correct numbers into the correct places? I'm willing to have multiple cells with formulas and simply hide the columns that are doing the calculations.
View 1 Replies
View Related
Oct 14, 2012
I've located the following color sort VBA that sorts worksheets by color and it is working well. I'm trying to modify the code to sort each of the "color grouped" sheets alphabetically. That is, sort by color and then each color group sorted alphabetically.
VB:
Sub SortWorksheetsByColor(Optional ByVal SortByAsc As Boolean = True)
Dim i As Long
Dim j As Long
Dim ShtC() As Long
Dim ShtN() As String
Dim t, n As Long
Dim lngSU As Long
[Code] .....
View 5 Replies
View Related
Mar 4, 2010
I havet he following code which sorts data. If there is no data to sort I keep on getting a run time error. Could I add something to my code to prevent the run-time error, as sometime there won't be any data to sort. The code runs when I switch to the worksheet in question.
Sub SortMeetings()
Dim iCTR As Integer
Dim yCTR As Integer
Dim zCTR As Integer
zCTR = 11
For iCTR = 12 To 23
For yCTR = 1 To 10
If Len(Range("D" & iCTR).Offset(0, yCTR)) 0 Then
Range("AA" & zCTR).Value = Format(Range("D" & iCTR).Offset(0, yCTR), "HH:MM") & " " & Range("D" & iCTR).Value
zCTR = zCTR + 1
End If
Next yCTR
Next iCTR
Range("AA11:AA" & zCTR).Select
Selection.Sort Key1:=Range("AA11"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub
View 9 Replies
View Related
Feb 26, 2009
I would like to sort columns B and C (keeping the two lined up together) so that A and B match up numerically.
View 3 Replies
View Related
Feb 22, 2006
I'm trying to sort numbers from an outline, so I want to sort it as 1.1, 1.2, 1.3...1.10, 1.11, and so on. Excel sorts them as 1.1, 1.10, 1.11...1.2, 1.3.
I have tried changing the format to several different types, including Number, Text, Decimal, and cannot get Excel to sort it in the correct order for an outline.
View 7 Replies
View Related