Sort By Column C And Then By Column B With VBA
Jul 9, 2009
I want to sort by Column C and then by Column B. I would like to do it with VBA and have it work for different documents. When I do the Macro recorder to see what the code is I realize that the RANGE and WORKSHEETS properties are very specific. The problem of course is that where ever I use this script I will not have the same ranges and the worksheet name might be different. Is there a more general way to write this to allow it to work on any of my documents.
View 4 Replies
ADVERTISEMENT
Mar 28, 2007
Here's what I have.. (on a much smaller scale)
http://www.jmetenterprises.com/produ...pics/excel.jpg
(notice how the lines that match are now even.)
[Edited by admin~ *Link* to large images, don't display them]
View 9 Replies
View Related
Aug 15, 2006
is it possible to leave a column out of this sort code as in A the very first column which just numbers the rows?
Here is my sort ....
View 9 Replies
View Related
Sep 23, 2006
I'm looking for a way to sort dates from several columns into a new single column (perhaps multiple columns if the entry columns become too numerous). I've included an example. There are currently only 4 columns, but there may be as many as 20 in the future, each with 20 dates under each heading. Any blank cells would be eliminated. If I filled a blank with a new date, that date would be placed into the chronological column. So basically, this would take the date from several different categories and create a single calendar of events.
View 8 Replies
View Related
Jan 10, 2010
I believe that the best way to evaluate this request is to look at the example. I have 2 buttons to demonstrate what I need, along with written instructions.
eMailSampleTest.xls
View 4 Replies
View Related
Mar 3, 2007
i want to sort column D acsending, then column C descending. i want to do this using VBA because i cant just format the sheet because another vba macro paste the sheet thier which would rid the formatting. (i would do it myself everytime but it is for someone to make it easier for them and not make mistakes..i searched, just found a sum formula post)
View 3 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
Nov 14, 2006
column A has random numbers 1- 10. Column B has numbers 1-10 also but in a different order. How can i sort column B to match Column A?
View 9 Replies
View Related
Oct 7, 2008
I have one column of names that has been entered as "first and last name" as one entry and I would like to sort by the last name (the last word in the column). Some of the entries are simply first and last name (e.g. Jane Doe), some are spouses together (e.g. Frank and Elaine Smith) and some contain middle initials (e.g. John Q. and Amy X. Public).
View 2 Replies
View Related
Jan 3, 2010
The below code works perfect, but I want to add to it so that if column F has a x rather than an eMail address, I don't want that row(s) included.
View 5 Replies
View Related
Feb 25, 2012
I have column a with the following names in A1:A10 with a corresponding number in B1:B10
Gold 7
Copper 1
Platinum 6
Brass 10
Aluminum 8
Carbon 4
Nickel 5
Iron 2
Titanium 9
Composite 3
I want to sort them from highest to lowest in C1:C10 & D1:D10. This meaning the part with the highest number would fall in C1 and its corresponding value in D1 and so on. Is this possible using a formula?
View 5 Replies
View Related
Jul 10, 2007
if it is possible to sort a range by a specific value in a cell in a column within that range. The reason I'm asking is that I would like to sort by street name in an address line, ie:
500 Aldavar Rd
32 564 Hughes Cresc
36 Aldavar Rd
14 263 Fairlane Ave
If these are samples in a column, I would like to sort, and have the following "output":
36 Aldavar Rd
500 Aldavar Rd
14 263 Fairlane Ave
32 564 Hughes Cresc
it is NOT critical that "36 Aldavar" appears before "500 Aldavar" in the output.
View 9 Replies
View Related
Jul 8, 2013
I have two DB extracts for 2012 and 2013 with customer id's that no not repeat across the year - columns A and B. I need to arrange this from:
2012
2013
270806
330011
330011
350529
350529
369916
to:
2012
2013
270806
0
330011
330011
350529
350529
0
369916
So the major idea is that the customers that are extinct in 2013 would appear as 0 in the Column B; customers that are the same would be aligned vs the previous year and new id's would appear on the separate row.
View 5 Replies
View Related
Oct 4, 2013
Is it possible for a column of "sums" to auto sort from largest to smallest? I have a dashboard with 20 charts and I want them to show in the order of largest to smallest but its rolling data so it changes daily.
View 6 Replies
View Related
Mar 24, 2007
Need the formula that I will need in my macro to move to the next column (up one letter) for the next time I run the macro witout me having to manually change column the letter?
View 15 Replies
View Related
Apr 29, 2006
Is there a way to automatically sort a column in ascending order while entering numbers so that the column is sorted when last number is entered.
View 11 Replies
View Related
Sep 25, 2009
I have 5 columns of numbers and at the bottom of each column I want to list every number in order from least to greatest and how many times it occurred in the column.
I'll just provide you with 5 rows of numbers so I don't waste a ton of space.
0628313841
0814364045
0203193042
0105101518
2021233335
View 14 Replies
View Related
Feb 9, 2007
I have the below small code which auto sorts information in column A & B but I am having trouble trying to get it to sort from row 3 and not sort the first 2 rows. The first row is the column header the second row I want left blank and then sort after that.
Plus at the moment after I enter something into column A it auto sorts itself but what I would really like to do is have it commence the auto sort after I have entered information in column B and pressed "enter". Because at the moment I enter info in column A then it auto sorts itself then I must then find it and then enter the info into column B.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rg As Range
Set rg = Columns("A") 'Column containing names to sort
If Intersect(Target, rg) Is Nothing Then Exit Sub
Range("A:B").Sort key1:=rg.Cells(1, 1), order1:=xlAscending, header:=xlGuess
End Sub
View 9 Replies
View Related
Jan 29, 2008
I have a 27R x 19C table (1st row is headings) that I want to sort. The column that I want to sort on (column O) contains a formula that multiplies two values, each of which is obtained by a VLOOKUP formula. The formula in the cell is: VLOOKUP(E3,StrategicImpactTable,2,0) * VLOOKUP(L3,StatuteRegulatoryImpactTable,2,0). Named ranges StrategicImpactTable and StatuteRegulatoryImpactTable each contain two columns, the second of which is a numeric value associated with the text in the first column.
On the first row VLOOKUP(E3,StrategicImpactTable,2,0) evaluates to 3, VLOOKUP(L3,StatuteRegulatoryImpactTable,2,0) evaluates to 2, and the product results in a numeric value of 6. The 26 values in column O are 6, 6, 4, 2, 2, 4, 4, 6, 4, 4, 4, 4, 9, 9, 9, 3, 3, 9, 9, 9, 4, 9, 9, 9, 9, 9.
When I sort the table descending on column O, the table does not sort properly, with no discernable order. Why?
View 9 Replies
View Related
Jun 29, 2008
Is there a way to have this sheet which is named "sheet1" sort the names in column A which is named "Name" by the data in column B which is named "Rank" automatically as the data in column B "Rank" changes?
A B1NameRank2Jones13Smith64White25Green76Alpha17Baker38Top59Low4
View 9 Replies
View Related
Jan 23, 2009
I have data in column C of rows 25 to 45. The data varies in number form.
What i would like to do is have some VBA code that i can place into a macro which will sort the numbers in column C of rows 25 to 45 putting the highest number at the the top (C25). But i need to move the complete row.
View 9 Replies
View Related
Mar 13, 2009
I have a look up table on sheet 1, that looks like this table to the right. On sheet 2, I need it to find the table contents in the column CC, then look at a column AA and find all that match it and move all that match this cell in column AA and copy the row it to sheet 3.
Its 300 lines of data, a couple of time of week.
It is a sort of data with a twist.
AABBCCDDEETreeDogCathousecardavemanboyjobbaseTableboatsamlaurasamjimboydaveweedwalkwalkruncatfunlaughboydivefloatTreeDogCathousecardavemanboyjobbasedaveweedwalkwalkrunfunlaughboydivefloat
View 9 Replies
View Related
Aug 18, 2009
I want a macro to sort Column A through B (Sort newest to oldest)that includes the first row. I can record a macro but it doesn't include row 1.
View 9 Replies
View Related
Jun 26, 2008
I'm looking to sort one column based on the values of another.
For example, if Column A has a list of names, and column B has a list of their ages, I just want to sort Column A based on the ages, but I want the ages column to stay as it is.
Is it possible to do this without a Macro? And if it requires a macro, how can I write a macro to make this work?
View 3 Replies
View Related
May 8, 2014
i have 7 columns from A to E of horse racing data.
Col A is Date, B is Time, C is number of horses in the race, D is the result placing E is the Odds
The data is in Date order and then by time then by order of place eg 1st 2nd 3rd etc
I am trying to sort the data by Odds for each race
Pseudo code would be;
Read Cell C2 (the start of the data) to determine the number of runners (example answer 10)
Select range Rows A2:A12 (10 rows from data in C2)
Sort Selection by column E[code]...
I wish the above pseudo code works as it seems so simple
View 2 Replies
View Related
Mar 6, 2014
This code sort data of every Column of workbook.
I want sort only range e.g (c10:c61) of sheet(10) correct this code :
[Code] .....
sample.xls
View 1 Replies
View Related
Feb 18, 2009
My rows and columns are as below
_____________________________________________________
A B C D E F
____________________________________________________
Basket 1 3 Basket 1 4 Basket 2 5
Basket 3 7 Basket 3 2 Basket 9 4
Basket 4 2 Basket 5 2 Basket 11 1
I want to bring all the baskets under column A in one row and Oranges in B, Apples in C and Lemons in D like this
Items Oranges Apples Lemons
________________________________________________________
Basket 1 3 4 0
Basket 2 0 0 5
Basket 3 7 2 0
Basket 4 2 0 0 and like wise.
What is the best way to do this.
View 5 Replies
View Related
Oct 28, 2009
I have about 3000 of these values per column. I need to sort the data so that column B and E are the same values. But the cells to the left and right of each B and E need to sort with it. Plus where there is a missing consecutive value I need a blank cell added...
View 8 Replies
View Related
Nov 29, 2012
I have a list of files in folders.
When I make the index of those folder, i have an excel list with in column A these numbers
1.1.1.1 (so the file 1 in the 1st subsubfolder in the 1st subfolder in the first folder)
1.1.1
1.2.1.1
1.2.2
1.3.1
etc... The list goes on with 1000s rows.
And in column B I have the names of the files
Unfortunately, when i sort the spreadsheet with the number on column A, the order is not good....
So I would like to find a solution to sort things in the good order.
View 7 Replies
View Related
Jul 6, 2013
is there any way to automatically sort a column from A-Z without need to choose column, sort&filter, a->z? maybe a pivot table?
View 1 Replies
View Related