Sort Into Regular Part Number Order
May 20, 2009
i have a list of part numbers that all have prefixes and i need to sort them into regular part number order and can't seem to figure out why i'm having such a hard time. the order i need them is this example. i need after part number 1-1 to be 1-2 followed by 1-3 etc. not 1-10 followed by 1-100. i hope i'm explaining this correctly.
View 9 Replies
ADVERTISEMENT
Feb 26, 2014
I found the code below on the Microsoft website and it works except it didn't treat the worksheet tabs as numbers so the sort is 1, 10, 100, 101 etc.
How can I get it to treat the worksheet values like numbers and sort accordingly?.
Code:
Sub Sort_Active_Book()
Dim i As Integer
Dim j As Integer
Dim iAnswer As VbMsgBoxResult
'
' Prompt the user as which direction they wish to
' sort the worksheets.
'
[Code]....
' If the answer is No, then sort in descending order.
'
ElseIf iAnswer = vbNo Then
If UCase$(Sheets(j).Name) < UCase$(Sheets(j + 1).Name) Then
Sheets(j).Move After:=Sheets(j + 1)
End If
End If
Next j
Next i
End Sub
View 1 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
Jun 10, 2014
I want the first 60 rows of column C to be constant meaning C1, C2, C3, C4..C59 and after 60 rows it should start again with C1, C2, C3.....C59 rather than C60, C61, C62. In other words i+1 but after 60 rows i should be reset to 1 and then again increase by 1. how can i implement these changes
[Code] ......
View 2 Replies
View Related
Jun 10, 2014
I need a formula that will calculate the number of days (ex from 10/1/08-1/1/12) and will differentiate between leap year and a regular year. I am trying to calculate interest between 2 dates and leap year is calculated on a different interest rate. Right now I have it set up so I have to manually type in the leap years in a separate field instead of being able to just you point a to point b.
View 2 Replies
View Related
Feb 19, 2010
I have so many part codes in column A with their Group in Column B.I want to arrange in ascending orders only those part codes which have almost matching in Column A with other part codes with different group.Please see the attached file and expected result.
View 4 Replies
View Related
Aug 2, 2007
i have A1:A60 filled with numbers. however, they are ordered incorrectly. how can i order then in B1:B60 in the following way?
1st cell
7th cell
13th cell
19th cell
25th cell
31st cell
37th cell
43rd cell
49th cell
55th cell
2nd cell
8th cell
14th cell
20th cell
26th cell
32nd cell
44th cell
50th cell
56th cell
etc.
until the 60th cell
View 9 Replies
View Related
Dec 10, 2008
I have a spreadsheet with 2 worksheets. On the first "active parts" I have a list of active part numbers and on the second "All Parts" I have all of the parts available.
I want to compare every part in the All Parts worksheet to see if the part number exists on the Active Parts sheet - if it's there, I would like it to return the value "Active" in column B in All Parts. I have a formula in column B in All Parts that seems to work for the first few, but as soon as it finds one that is active, the rest of the cells below all return "Active".
View 3 Replies
View Related
Aug 4, 2006
how can i sort a text column by the last words after the "-" automatically. For example, this is a text column:
1. 12634 - Sweetare Dr. - Garden Grove
2. 15234 - Hotflame Dr. - Irvine
3. 16612 - Arigato - Japan
4. 22634 - Saigon - Garden Grove
I need to sort the column by the word(s) after the '-' sign.
View 5 Replies
View Related
May 9, 2014
I have a list of data with headings number,name, surname,group. Data needs to be kept in the rows as they are now but I would like to sort the order by group. The group order needs to be:
sm, u17m, u15b, u13b, u11b, sw, u17w, u15g, u13g, u11g. I would like to do this using vba and have a blank row between each group.
View 11 Replies
View Related
Feb 10, 2009
I need values from column F in ascending order.
Also I need in column G only the values without formula.
View 14 Replies
View Related
Nov 20, 2007
I'm sure this has been asked many times before, but I can't seem to find an answer that works for my data. I have some data that is sorted by an ordered list (like a table of contents from an overly detailed book):
1.0
1.1
1.2
1.2.1
1.3
...
1.11
...
This list can be arbitrarily deep (although probably not more than ##.##.##.##), and because I'm using periods to separate the nested levels (can be changed), I've formatted it as text. This means when I sort the data using this column I get 1.11 before 1.2 (text sort order).
After lots of failed formula attempts I've resorted to using an additional column with hand-entered values to sort by so it will sort correctly:
1.00.00
1.01.00
1.02.00
1.02.01
etc
but I'm hoping someone knows a more elegant way to do this, or at least to generate this column without typing so many zeroes!
View 9 Replies
View Related
May 30, 2008
I have a client with a list of books, and they are trying to sort a column in a sheet that has LC classification codes. When just doing a normal A-Z sort, it looks like this:
RJ 41 .D53 F54 2005
RJ 416 .L4 C52 1999
RJ 420 .D5T97 2003
RJ 421 .H385 2006
RJ 426 .H43 P43 2005
RJ 431 .M37 2003
RJ 436 .A8 R33 2006
RJ 436 .A8 T498 2001
RJ 436 .A8 T87 2003
RJ 45 .N4 2000
RJ 45 .N418 2006
RJ 45 .R92 1998
RJ 47 .E39 2001
RJ 48 .H37 2000
RJ 48 .H37 2002
RJ 48.2 .C537 2004
RJ 48.2 .P347 2005
RJ 48.2 .P385 2005
RJ 48.2 .R93 2003
RJ 480 .P34 2005
RJ 482 .R48 L448 2004
RJ 486 .C45 2000
What is weird about it is that I would think that the numbers after the RJ would be in numeric order but it seems to be treating them as codes. So, instead of RJ 41, then RJ 45, it goes on with a series of things that start with RJ 41. Is it normal for this to happen, or is there a way to change it so that it goes 41, 45, 47, 48, then 416, 420, etc.
View 9 Replies
View Related
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?
View 9 Replies
View Related
Nov 2, 2011
I'm trying to run a script from a CAD software which exports property values into an Excel spreadsheet. I need to then sort the spreadsheet by part numbers (which are located in column G) but my script is not working correctly. My data range is A1:G50.
Const xlCenter = -4108
Const xlAscending = 1
Const xlYes = 1
Const xlSortOnValues = 0
[Code] ............
View 1 Replies
View Related
Apr 10, 2006
I have data with two types of records: those with "orders" in teh comments field and those with something else in that field. I'm able to sort on comments so "orders" records appear at the bottom, and insert two blank rows, separating the two datasets. Now I have to be able to set the range of the top portion. I worked on the problem, and used some of the code in the response to my post. I need to store two cell addresses.
To determine the range, I find the first blank column, then move one cell to the left, then I need to store that column's letter. AFter I find the first row with "orders" in the comments, I need to insert two blank rows and move back up to the row above that containing data (this much I've done), then store that cell's row's address. I need to use the column and row I record as the range to select for the sort. So, I basically need to things:
1. How to store the active cell's column and row
2. How to stop recording, type in code, then resume recording.
View 8 Replies
View Related
Dec 17, 2013
I have imported data and numbers from a website and would like to sort the data in numerical order. Excel wants to sort the data 1,10,2,20... in that order. I know from past experience with an older version there was a way to convert the numbers so they can be sorted in the way that I want.
View 2 Replies
View Related
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] .....
View 9 Replies
View Related
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)
View 1 Replies
View Related
Feb 20, 2009
I have a spreadsheet for work that consists of various columns of data. One important sorting column would be Job #. Inside this coulumn are data like 134-Q and 2355-P and 755-P for example. The sort now is like posted. I would like to be able to sort by both alphabetical and numerical order. ie, 755-P, 2355-P, then 134-Q.
View 5 Replies
View Related
May 1, 2013
My dates are sorting as per the image below.How do I get them to sort in chronological order (e.g. 01 January, 02 January etc)
Excel Forum.PNG
View 10 Replies
View Related
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.
View 4 Replies
View Related
Oct 19, 2009
I have to sort data on 3 criteria
The data is:....
At this time I sort by HOURS then Seniority so the sort would look like this:........
Here is the problem, RN HILLER and JA DOE have the same hours and seniority. It is our policy that when 2 or more names and seniority match, they must be sorted by reverse order first letter of last name.
So this would be correct. H in Hiller comes before D in doe when reverse sorting.....
View 4 Replies
View Related
Oct 7, 2011
I have the below code that sorts a list of Doors that I have in row C17 downwards. Door 54, Door 7, Door 109 etc. The list is feeding a drop down box, people find the door they were looking for, in the said drop down box.
Code:
Sub ListSorter()
Dim LastRow As Long
LastRow = Range("C" & Rows.Count).End(xlUp).row
[Code]....
I wondered if there was some code I could add to the end of this, that would the sort worksheets, which are all named after each cell in the list, in the same order.
View 3 Replies
View Related
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] .....
View 3 Replies
View Related
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.
View 9 Replies
View Related
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()................
View 6 Replies
View Related
Aug 9, 2006
I have a worksheet populated with text and values from column A to BG, and from row1 to row550. Column B contains only the following text and values:
TKM SG
1
TKM Kulim
zero bin (internal)
0.33 bin (internal)
3
ESC
2
zero bin (AMA)
I need help for VBA code to sort the worksheet by this order of preference in col B as follow. Appreciate your help.
1
2
3
TKM SG
TKM Kulim
zero bin (AMA)
zero bin (internal)
0.33 bin (internal)
ESC
View 5 Replies
View Related
Feb 23, 2007
I am trying to do 2 things.
1) I want to make a drop down box with 3 differnent sort orders options in it.
- Sort by date
- Sort by Customer
- Sort by priority level
Once they select a view, it will then sort the rows to that view.
2) I want to do a filter box, so if I type a cutomers name, it will filter to only show the rows related ot that customer.
View 9 Replies
View Related
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.
View 2 Replies
View Related