Sorting And Renumbering A List
Sep 13, 2006
I have a spreadsheet with a list of jobs in it, with a bunch of columns describing various aspects of the job. (Supervisor, department, etcetera.)
I also have a priority column.
What I'm looking for is to have my list renumber itself when I change the priority on jobs.
For example:
Priority Job Name Supervisor
1 Dig Ditch Ben
2 Fix Window Sira
3 Check C2 Cory
4 Check SS Ben
Let's say I change "Check C2" to be priority 1, I would like my priority list to re-order itself to:
Priority Job Name Supervisor
2 Dig Ditch Ben
3 Fix Window Sira
1 Check C2 Cory
4 Check SS Ben
Also, bear in mind that the list might not always be sorted by priority. It is just as likely to be sorted by Supervisor or one of the other columns not mentioned here. Data Validation keeps the numbers whole & positive.
My problem is mostly thus...
I try and capture the change through Worksheet_Change. However, each time it increments one of the priorities, it runs the Worksheet_Change event again, giving me priorities in a nice Fibbonacci-looking sequence. Aesthetically & mathematically interesting, but totally incorrect.
Also, for some reason, if I delete the last job (or just the priority of the last job), it never terminates the code, and runs, incrementing the code and pushing my priorities up & up & up.
This is my
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Rows.Count = 1 And Target.Columns.Count = 1 Then
If Chr(Target.Column + 64) = PriorityColumn And Target.Row > SortRow Then
Dim Changed As Boolean
Dim Max As Integer: Max = 0
Dim i As Integer
View 9 Replies
ADVERTISEMENT
Apr 12, 2013
I have two excel files. One file has the three digit code of more than 5400 airports of the World where as in the other file I have the different airlines with departure airport - arrival airport. Now instead of the three digit code, I want to simply number them from 1 to 5400. And then I want to match this information of the airport number with the arrival and departure airports, so that in this file I don't get airport digit but the airport numbers as I defined in my previous file. I am illustrating it below.
File 1:
Airport IDAAA
AAC
AAE
AAF
AAG
AAL
AAM
AAN
AAQ
AAR
AAT
AAX
File 2:
AirlineDeparture AirportArrival Airport
US AAA AAX
US AAA AAG
US AAN AAR
QT AAQ AAM
and so on...
now what I want is like this:
File 1:
Airport ID
AAA 1
AAC 2
AAE 3
AAF 4
AAG 5
AAL 6
AAM 7
AAN 8
AAQ 9
AAR 10
AAT 11
AAX 12
File 2:
AirlineDeparture AirportArrival Airport
US 1 12
US 1 5
US 8 10
QT 9 7
I hope it is understandable now, all I want is to change the airport codes into numbers and then match the airport numbers with the departure arrival so that instead of codes I have the defined airport numbers. Is it possible?
View 5 Replies
View Related
Feb 24, 2006
I have a database being exported to a spreadsheet with over 40 fields (columns) and 1000+ clients (rows). One of the fields (column C) incidates that referral source. I would like to copy & paste the list into sheet 1 and have 5 seperate sheets for each of the 5 different referral sources. So that when I go to sheet 2 the only thing I will see are the clients and their 40 associated fields that are referred (column C) by say "John Smith"
Is there a function or script that will search column C for "John Smith" and then fill in all the 40 fields on sheet 2.
View 11 Replies
View Related
Feb 2, 2012
I have a large list of names that I am breaking into three groups based on last name (A-G, H-M, and N-Z). The spreadsheet is then sent to a group of processors who work on the names that are found on their tab.
I start out with the complete list on each tab. Then I use a For Next loop to go through each tab and delete the rows for the names that do not below on that tab. This process is working fine, but I am figuring their is a better method of doing it.
Code:
Sub PopShts()
Dim wsAG As Worksheet, wsHM As Worksheet, wsNZ As Worksheet
Dim lRow As Long
[Code].....
View 4 Replies
View Related
Apr 15, 2014
have data in the attached file arranged as follows:
"Source Data" sheet Data in columns A to L will be updated daily by pasting from another workbook. On any given day the data in columns A to L may have more or fewer rows than the day before.
"Lookup Table" sheet The aim is to return the data from the "Source Data" sheet; the selection depends on the Data Validation choice in cell O1.
I would like to be able to sort this dynamic list of data - ideally by clicking a single button - in descending order of the values in column L.
View 6 Replies
View Related
Mar 11, 2009
I have a list of movie titles A3-A9999(Infinity), their disc numbers in B3-B9999(Infinity). The titles being written in text, of course.
All I want to do, is have another list, in the same sheet in D3-D9999 that will be the same list as the original list that I input movies onto, except alphabetical and automatic from when I type in the movie title in the original list. When i just use "=A1, =A2, =A3 ~~~ =A999" in the D cells, then try to sort, it only sorts by the cell numbers, not by the actual text that I want it to.
Is there a way to do this? I know excel relatively well, but I'm definitely a noob compared to experts.
View 4 Replies
View Related
Jun 7, 2013
I'm having some problems sorting a list of numbers that some are larger than others, but it would sort it by how large the number is in regards to 123 or 45... 45 would go first instead of 123... I tried to change the column to numbers but it still won't work. as well as in the custom sort section. I'll try to upload a sample...
View 11 Replies
View Related
Feb 21, 2010
I have the attached workbook that contains a list of produce in the Produce sheet and I am wanting to have the Availability sheet show what produce is available each day sorted into Good, Limited and None as per the data on the Produce sheet. I should end up with a list of each type of produce listed under the relevant availability each day.
Sorry but I have limited knowledge of VB, I assume that the best way to do this is some code behind the Availability worksheet but I am not able to determine what this code should look like.
View 9 Replies
View Related
Jul 17, 2007
I have a list of potential competitors in an event, and am using both RAND and ROUND to sort them into a list of 1's and zeros. My formula is as follows: =ROUND(RAND()*1,0). My problem is that I get an uneven distribution of players, out of a list of forty, I may have 38 people that are 1's and 2 people that are 2's. I'd really like the list to be randomized, but evenly to allow for fair competition.
View 3 Replies
View Related
Mar 1, 2014
with this problem (which I've been trying for weeks to solve).
I have a column ("C") of 640 numbers, which I need to randomly sort and place into the adjoining (ten thousand) columns. I then need to correlate each of these 10k columns with column "B".
The problem I have with the attached (which works for small numbers), is that when I increase the table size to 640 rows and anything more than a dozen or so columns, it takes forever to calculate and Excel often crashes.
random ver 1.04 280214.xlsx
View 1 Replies
View Related
Apr 15, 2014
I need to create a table with the top 14 'ReNo' for each code listed in columns F1-R1. These need to be in chronological order. Also if the code is part of the latest date then that first ReNo. needs to be ignored (since it will not have completed its cycle).
getting to the formula I have but I can't get it to sort in these ways, so as it is its not working right.
Example3.xlsx
View 3 Replies
View Related
Oct 13, 2008
I want to sort the list like this:
1) If there is a zero (null) value in all 3 months, these records should be at the bottom sorted by record name (I did not show this field in my file).
2) If there is a non-zero (non-null) value in any of the 3 months, the records will be sorted with each other by total change.
Is there a way to do this without me doing sorts multiple times and manually moving rows of data around (which is what I have done to arrive at the list I have attached)? I am not experienced with VBA or Macros, and would prefer a detailed explanation if a solution is using either method.
View 2 Replies
View Related
Oct 25, 2011
I work for a printing company that prints labels. We have 6 printing presses, lets call them A,B,C,D,E & F. Certain labels can only be printed on printing press F.
From our business system I can run a report in excel format giving details of all the labels that we have sold in the present month. I need split that report into 2 separate excel spreadsheets; 1 showing everything that was printed on presses A to E and the other showing everything printed on press F.
I also have another excel spreadsheet which gives a complete list of all the labels that have to be printed on press F.
Every label that we print has a part code and both spreadsheets show this part code so that would be the linking factor between the 2 sheets.
View 1 Replies
View Related
Sep 24, 2006
This should be a simple question for those who have the knowledge. I am making a 2 column excel page, the first column will have an authors name and the second one will have the book name. I need to lock these two columns together so that author name and book name always stay together (side by side) on the sort command. I need to be able to sort by author or book title and I realize that it gives you the choice to expand the selection, but I can't trust that the others (kids) will realize the importance of doing so. This is going to be a very large list with hyperlinks and I can't afford to chance whether someone else will select the correct command. So a long story short. I want to build a list that can be sorted by author name or book name and be sure that the correct author will always be beside the correct book, but that are able to be independantly sorted
View 5 Replies
View Related
Apr 9, 2008
I've tried to sort a list using the sort 1st by and then by options, but it will only sort by one of the options. I've tried with a header row, without a header row and every way I can think of and still can not get it to sort by more than one column on this particular list.
View 6 Replies
View Related
Oct 29, 2013
Using Excel 2007, I have a very simple spreadsheet made up of only two worksheets that I am using to track the songs played by a band during a current tour.
One worksheet is called "Summary" and the other is called "Setlists". In the Setlists worksheet I list every show played (10 shows so far), and every song played from each show. In the Summary worksheet I have very song listed that has been played during the tour in one column (A), then the number of times that song has been played in another column (B). Column B, the number of times each song has been played, is populated by a COUNTIF function that looks at the Setlists worksheet and counts each instance of each song.
What I want to do, very simply, is to sort on column B in order to display the list of songs from the most played to least played. That is where I run into a problem. When I sort my list of numbers, I end up with a seemingly random list that certainly isn't from most to least and I can't figure out why.
Is it possible that the COUNTIF function which populates that column of numbers is somehow throwing off the sort?
View 6 Replies
View Related
Aug 24, 2012
I am using Excel 2003.
I have a pivot table in sheet1 and references in sheet2 like
Code:
='Sheet1'!A1
and so on to copy the whole thing to make it the source data for a bubble chart.
Now, I want to convert the table in sheet2 into a list via Ctrl+L to be able to sort by names with a dropdown menu. Unfortunately, I have to copy all rows from 1 to 1000 to account for possible increases in the pivot table size. This results in blanks in the list and when I want to sort it, I have 990 blanks before the first data rows show up. Not very neat
View 1 Replies
View Related
Feb 5, 2013
I am trying to sort a list of business development leads. When a lead is dead I enter the date in the column entitled "Closed". Therefore, the Closed cell for active leads is blank. Whilst I still wish to retain the information of dead leads, when sorting I would like them listed at the bottom of the list. However, whenever I sort on the Closed column, whether using newest to oldest or oldest to newest, the blank cells are always at the bottom, instead of the top.
How to get the sorted blank cells to the top?
I'm using Excel 2011 on Mac OS X 10.7.
View 2 Replies
View Related
Mar 6, 2009
how to create the database and the resulting Pivot Table. My Sales Database includes the Sales $ and GP$ for each line. In the Pivot Table I've managed to create a calculated field for GP %, no problem.
i have also managed to figure out how to express each Row as a % of the Pivot Total, also very easy.
What I need to know is how can I sort my Pivot Table High to Low using these calculated fields?
View 9 Replies
View Related
Oct 4, 2003
I don't understand all of it, but I observed that it works only with mp3 with tag id v1, not v2, anyway I also see another code for tag id v2 given by NateO.
But before entering in detail of what I want, is it possible to edit tag id v1 or even v2, with VBA? Because I want to complete my mp3 informations that are missing, or modify the wrong one, in excel, and then with a macro update my mp3 files...
I've found this code on the forum to get my mp3 informations :
Option Explicit
Public Type mp3Info
Header As String * 3
Title As String * 30
Artist As String * 30
Album As String * 30
Year As String * 4
Comment As String * 30
Genre As Byte
End Type
Sub Getmp3Info()
Dim mp3ID As mp3Info
Dim lngRow As Long, lngFile As Long
Dim lngFileCnt As Long
With Application.FileSearch
.NewSearch
.Filename = "*.MP3"
.LookIn = "H:Daniel" 'Change this to the folder you wish to search
.SearchSubFolders = True........................
View 9 Replies
View Related
Jun 21, 2007
I have a sheet with fixed number of rows but variable number of columns. I have to sort this sheet on the basis of column A starting A2. i am using the following code
Range("A1", Range("A1").End(xlToRight).End(xlDown)).Select
Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlYes
But it does not sort properly. To illustrate, i have 10 rows, some 4 columns wide and some 5 columns wide. Since the first row is 5 columns wide , all the rows with 5 columns populated get sorted but the rest get left out.
View 2 Replies
View Related
Feb 18, 2007
This is an example of what is being worked on:
(There are 500+ more lines like the ones below, in groups of approximately 17 lines per page of information.)
* C.B.A. Bank - 2nd reference to branch near Mike's store. (21/03/1956)
* Berwick exams results. (06/06/1877)
* Berwick exams (09/05/1877)
* Steps taken for erection of Berwick. (11/07/1874)
* Berwick tenders for work at home. (11/07/1877)
* W. was a storekeeper at Berwick. (25/07/1881)
* Berwick Brass. (27/06/1877)
* Commercial erected for son. (27/06/1878)
I need to do the folowing to it:
(not necessarily in the following order)
- Insert into Excel
- Remove brackets
- Sort chronologically
- Copy back into program I am using again, in same chronological order.
The desired outcome is to be able to throw into Excel all the lines and press a button, (possibly the Sort Ascending one) and have a chronological list of all entries.
View 10 Replies
View Related
May 11, 2007
I have a table which holds scores as well as other data for players. Is it possible to automatically sort a table based on their points score to see who is top of the league?
View 9 Replies
View Related
Nov 6, 2007
Is there a code or some way for me to sort 4 columns together? I want to sort a list of employees and for each employee theres a column with their Lost Business, customer satisfaction, and two more columns. I want to sort all the columns at the same time so that the best employees overall will go to the top of the list and the worst ones will be at the bottom. Whenever I use the sorting feature it does each column independant of the others so everytime I sort a new column it just moves around the last one I sorted.
View 14 Replies
View Related
Jan 12, 2008
I have five columns of data A to E. In each row there can be data in either 2 3,4 or 5 of the columns. What I want to do is essentially condense the data. So in columns, say, G,H,I J,K if there is data in column A then It goes into column g, if not it asks if there is any data in column b and so on. Then for H it does the same but one on. I have attached an example to show what I would like to happen.
View 9 Replies
View Related
Jun 20, 2008
I created a data base that had a hyperlink to a plan of the store so we can find parts easy. With a lot of help for people here on this web site, it works very well.
My only problem now is that I sorted my Database by the hyperlink column. It made it easy to do one hyperlink and pull the fill handle down for the rest of the same hyperlink reference.
When I went to resort the database so that the parts were in alphabetical order. The sort worked well except that the hyperlink for lets say cell F87 was not sorted. Example : - F87 hyper link presort had the reference to Rack 10 self B. Post sort it had the reference to Rack 16 shelf C. But when clicked on it still took you to Rack 10 self B.
View 11 Replies
View Related
Nov 14, 2008
I'm trying to sort this spread sheet so that each email address will have its own column assigned to it. Ie jaz@hello.com will alway be column C and harry@hello.com will always be in D. The problem is I've around 1200 rows of infor and the email addresses are all over the place..
View 5 Replies
View Related
Dec 20, 2008
how can data sorted be more frequency as most frequent on top and as the following:
1
1
1
2
2
3
3
3
3
to
3
3
3....................
i attach file
View 3 Replies
View Related
Aug 9, 2009
I have around 1900 dates that I need to sort into order but I need the data to be displayed as DD/MM in chronological order eg 01/01, 02/01 etc.
At the moment the dates are DD/MM/YYYY in one column. Have tried sorting them into date order but have found that they're sorted by YYYY. Is there a way of sorting them DD/MM instead?????
View 5 Replies
View Related
Aug 26, 2009
I should sort numbers in ascending order from left to right, but the numbers sort only from right to left.
This is what I want:
1.3.2.2
1.4.1
2.1.1.1.1
3.2.3.12
3.3.1
And this is how it goes:
2.1.1.1.1
3.3.1
1.4.1
1.3.2.2
3.2.3.12
There are also numbers that have letter at the end (1.2.3a), and the cell format is text.
View 10 Replies
View Related