I feel like this should be somewhat simple, but none of the normal methods I know seem to work. I want to set up a formula (not a basic sort, since I want it to automatically correct every time I change information) so that for each row, several columns re-sort by date.
For instance, I have the following table:
Item Type Dates
A DV 5/2/14 6/12/14 7/11/15
B DS 3/11/13 6/19/14 1/2/15
C LG 11/12/14 8/1/15 1/12/16
...
where each of the dates is in a new column, but the "Dates" title is merged between the cells
I want to be able to resort just the date columns(/cells) for each row if a new date is written. I want the dates to be in ascending order. For instance, if I go back into the worksheet and replace Item A's date 5/2/14 with 1/1/16, I want the date columns JUST FOR Item A to reshuffle/resort to be:
A DV 6/12/14 7/11/15 1/1/16
without it resorting any other rows (Items) columns.
I am making a barrel racing spreadsheet. In Column B I am putting the participants names, in Column C I am putting the name of their horse. So Row 1 will be my header row. What I am trying to do is a random shuffle, but the participant and their horse have to stay together. Also is there a way, where I can put the stipulation, that if a person is randomly put in number 5, that she has to be at least 3 spots away from that number.
I am working on a Random Password Generator. Our requirements are that the password should contain the following:
- mixed case letters - at least one number - at least one "special" non-alphanumeric character
I created a UDF to do this that works. However, the way that I did this was like this: - 1st character: special character - 2nd character: numeric - 3rd character: lower case - 4th character: upper case - rest: any alpha-numeric characters
So while they are "random", they all follow the same "pattern" for the first four characters.
What I would love to do is once I have created the random password, to "shuffle it up" or "mix it up" in random order. So something like: $2dNKqSc would be "shuffled" and would would return something like: SN$qc2dK (all the same letters, just in random order)
I was trying to do it with Arrays, but I have to admit, arrays are not my strong point. Can anyone help with the last piece? Here is my code that creates the random password.
Public Function RandomPass(myLen As Byte) As String ' Generates a random alpha-numeric password (with special characters) of specified length ' If this is stored in your personal macro workbook and not in the workbook itself, you must qualify the personal macro workbook file to use it ' i.e. =PERSONAL.XLSB!RandomPass(8).......
I have a table with 36 numbers - 6 x 6 that means 6 rows and 6 columns. Numbers 1 – 45.
I want Excel to shuffle the numbers (random shuffle) so they will come in different combinations on each row and column BUT the numbers must not repeat (no duplicates) in the same row or column.
I am using Excel 2011 and we have a link data source to the outside SQL Server.
For the 1st step, I linked to the Database and retrieve the data.
P1.png
2nd step. Sort the data by using the column "Description" Descending. Add another column to the table and put the 1, 2, 3, etc in that column.
P2.png
3rd step. I clicked on "Refresh" and the new column values are not consistent. I mean they are moving. So, I added another row in the database to test and it becomes very obvious. It can be clearly seen at the following image. The value of "A" should always be "10", but it has been changed to "1" after the refresh.
P3.png
how I could retain the position of another column after the data refresh?
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:
I found this code on Ozgrid to sort all columns of a worksheet that were continuous with no gaps or spaces that works well:
Sub CopyToA() Do While ActiveCell <> "" Range(ActiveCell, ActiveCell.End(xlDown)).Cut Destination:=Range("a65535").End(xlUp).Offset(1, 0) ActiveCell.Offset(0, 1).Select Loop End Sub
However, I've tried to manipulate the code myself to 1) find all columns that aren't empty then 2) sort each column individually (WITHOUT expanding the sort to other columns) and 3) combining all the numbers into one seperate column. There are many posts concerning sorting but not one that addressed this particular situation.
Have a spreadsheet with 15 columns. In one of the columns is the name of the company and that column is not in alphabetical order. The city, state, zip code, business type and all the other pertinent data about that company is in the same row as the name of the company. My intent would be to put the company names in alphabetical order and keep all the company information in the same row as the company name.
I have two columns one is web addresses and the other is email addresses but the rows do not line up. I was hoping that since the second half of the email address matches the web address I could somehow sort them so that the email address column and web address column match up. Here is an example but keep in mind that this list is about 9k long and this is just a sampling so you may not see any in this example that match. Also I may have more than one email address per website.
A1 - Header - "Holidays in XXXX' B1 - Header - "Holidays in YYYY' C1 - Header - "Leaves by YOU"
A2:B11 have static dates consisting of 10 dates in each column. C2:C11 - the user may enter any date at any point of time.
I would like to auto-merge the dates in all the 3 columns (A2:C11) in a single column say D2:D31 and then the system should auto-sort the column based on dates in any one order. So as soon as the user enters a value in say cell C2, all the 10+10+1 dates should get sorted.
Also the constraint here is a user may not apply all 10 leaves at in a year. So many of the cells may have blank values.
I am using a formula but when it sorts with the data in the adjacent cells it does not update the reference cells properly.
For example here is the =SUMPRODUCT(($F$12:$WWX$12>=C1)*1,($F$12:$WWX$12<=E1)*1,ABS($F$13:$ZZ$13))
This code is located on row 13, when I do a sort function with all the data, this code is then moved to row 30, that is fine but the code changes in the following way:
C1 & E1 should not have changed at all, F13 & ZZ13 should have changed to F30 & ZZ30.
I am not sure if there is a way to fix the formula so it updates correctly, or these cells can stay in the same place as long as everything else sorts.
I am trying to get columns A:E on Sheet1 converted into columns A:H on Sheet2. I attached the workbook with the macro so you can see what I am talking about. I posted the same macro in the workbook below. It comes close to what I am trying to do but it only sorts based on Column E. I would like to include Columns A, B, C, and D in the sort instead of just Column E so the display will look like Sheet2.
I'm having a bit of trouble creating a macro that will sort columns in order - I've created a form that allows people to select a broad category ie) Schools, then a sub category ie) Primary or Secondary, and type in a third ie) Projects or Teachers
I'm trying to write a macro so that once they enter the form, their choices will be automatically sorted alphabetically, first by column A, then B, then C - to look like:
Schools - Primary - Projects - A Schools - Primary - Projects - B Schools - Primary - Projects - C Schools - Primary - Teachers - B Schools - Secondary - Projects - C Schools - Secondary - Teachers - A Schools - Secondary - Teachers - B Schools - Secondary - Teachers - C
However I'm having the issue where if column B or C are left blank - the columns are not sorted properly, and the categories in column A get separated out..?
I have the necessity to execute a macro for sorting a list of data on two columns. More exactly, let's suppose to have this situation:
A 10/2/2008 FFFF GGGG HHH B 01/3/2008 PPPP LLLLL NNNN B 12/4/2008 XXXX JJJJJ PPPP B 08/1/2008 HHHH SSSS IIIII C 15/10/2008 AAA BBBB CCC
I need this sort: A 10/2/2008 FFFF GGGG HHH B 08/1/2008 HHHH SSSS IIIII B 01/3/2008 PPPP LLLLL NNNN B 12/4/2008 XXXX JJJJJ PPPP C 15/10/2008 AAA BBBB CCC
r = Range("c65536").End(xlUp).Row Range("a5:G" & r).Select
Selection.Sort Key1:=Range("G5"), Order1:=xlAscending, Key2:=Range("F5") _ , Order2:=xlAscending, Key3:=Range("C5"), Order3:=xlAscending, Header:= _ xlNo, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, DataOption3:= _ xlSortNormal Rows("4:" & r).Select For i = 5 To r Rows(i).Select If i Mod 2 = 0 Then Selection.Interior.ColorIndex = xlNone Else Selection.Interior.ColorIndex = 36 End If Next Range("j5").Select Application.Calculation = xlCalculationAutomat
this sorts range from A to G and set color to each second row how can I include S column in this range I mean that cells in column S are moved with cells from columns A to G.
I have column A which contains a range of part numbers, and column B is an On Hand quantity of that part number.
Column C is just like column A, in that it contains the same part numbers but it has about 1,000 additional part numbers that are obsolete. Column D has the On Hand quantity for Column C.
Column A and B are old information as far as the On Hand quantities, where Column C and D are up to date On Hand. The problem is the old outdated part numbers in column C.
How do I make column A and column C match, but not lose their respective On Hand quantities? I know this sounds discombobulated, but basically I need column A's part numbers, with column D's on hand quantity.
I have 3 columns; A:Name, B:Debit & C:Credit. There are multiple row (approx 15,000) where I have a customer name and then a debit at one date, and a credit at another date. There is a debit to match every credit.
I would like to some how sort the sheet so that I can make sure each credit matched the debit. That way I can find what debit's don't match the credits. This is an example of how this looks. http://i303.photobucket.com/albums/n...kejoe/sort.jpg. I would like to sort it like the example on the far right (see attached picture)
Column A has customer name, columns B,C,D has corresponding sales data for that month. Column E is blank. Column F has has customer name. Column G,H,I has the same corresponding sales data for the next month.
Although Column A and F both have customer names, there are many changes month over month with the addition and deletion of certain customers so the rows do not match up exactly. Is there a quick way to have the rows match up according to customer names in column A and F and then sort them alpabetically?
Currently my list looks like this: Jan Feb A A B C D D F E H F L G M H
I would like it to look like this: Jan Feb A A B C D D E F F G H H L M
I have a list of domains (about 200,000) that looks like this:
I have a list of urls (about 1 million) that looks like this:
I want my results to only show this (since this is the only thing in the second file that does not contain anything from the first file):
I have tried programs designed to do this but they either (a) shorten everything down to the domain or (b) wont remove anything since the domains are part of a longer url in the second file.
I am trying to write a Macro to basically do a lot of redundant formatting for me and I am stuck on one part of this code. Everything else works just dandy, but I am having the darndest time getting this Macro to sort by 2 columns instead of just 1.
I did the basic first step and recorded myself sorting the datasheet by both columns in 1 sort and got the code, but the problem is that the number of rows will change day-to-day, week-to-week, and so on, so I need it to not specify a cell number as the end of the range.
While searching around, I saw a very handy little piece of VBA code that will search for a header name, which is really nice because that would make it much easier to share this Macro with my coworkers who have different reports that all have columns in different locations.
So, I have a multi-part question. I will start with the most important one:
How do I alter this to not specify A9590 and D9590 as the last cells in those ranges?
Is there a way to have the Macro find where the header row is? The header rows in our reports can appear anywhere from Row 1 to Row 8 depending on how the report is set up (usually we have some information about the data, date range, etc at the top).
Dim c As Integer With ActiveWorkbook.Worksheets("Date XREF").Range("A5").CurrentRegion c = .Find(What:="Assignment ID", After:=.Cells(1, 1), LookIn:=xlFormulas, _ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False).Column .Sort Key1:=.Cells(1, c), Order1:=xlDescending, Header:=xlYes, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom End With
And I want to sort it to look like the following, in order to track each number to a date and to enter into an external database...
Date #
1/1/11 1000
1/1/11 1001
1/1/11 1002
I need to list the entire thing instead of having starting and ending part #s. Any macro to do this? The actual spreadsheet has 250 dates and over 30k part #'s so doing it out is not really an option.
I have a code with perfectly sorts Excel rows when you click a button:
Private Sub CommandButton1_Click() Worksheets("Sheet1").Range("C1:S70").Select Selection.Sort Key1:=ActiveCell, Order1:=xlAscending End Sub but if i like to sort the columns by Row 1 how i can do it?
I'm trying to sort selected rows by two columns, but simultaneously instead of sorting by "Column A and THEN Column B". In my case, this is numerical data where there is ONLY data in one column or the other, never both.
Is it possible to re-order entire columns based on cell values? For example, row A gives values of 1 thru 10 to the first 10 colums. I would like a macro that reorders the entire columns based on that value.