ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   sort 2 columns with "large" (https://www.excelbanter.com/excel-programming/287679-sort-2-columns-large.html)

Dan Kraemer

sort 2 columns with "large"
 
I have been told I can sort column A with the "large" command, and have associated names in column B sort the same way if I select both columns together and then sort by "large",- but I don't understand how to do this. Where do I put the command? When do I select the 2 columns? Exactly what does the command look like? e.g. If ages 10, 20, and 15 are placed in cells A1, A2, and A3, and names X, Y, and Z are in cells B1, B2, and B3; where do I put the command and what does it look like, to sort column A in descending order and keep the same names associated with the ages in the column beside it? Thank you for your help. Dan

Mike Fogleman

sort 2 columns with "large"
 
To do this manually, select all the data you want sorted. On the menu click
Data/Sort. Choose the column to want all the data to sort by (column A for
age) and select Descending if you want the oldest age listed first.

"Dan Kraemer" wrote in message
...
I have been told I can sort column A with the "large" command, and have

associated names in column B sort the same way if I select both columns
together and then sort by "large",- but I don't understand how to do this.
Where do I put the command? When do I select the 2 columns? Exactly what
does the command look like? e.g. If ages 10, 20, and 15 are placed in cells
A1, A2, and A3, and names X, Y, and Z are in cells B1, B2, and B3; where do
I put the command and what does it look like, to sort column A in descending
order and keep the same names associated with the ages in the column beside
it? Thank you for your help. Dan



Mike Fogleman

sort 2 columns with "large"
 
If you want VBCode to do this, try this:

Sub SortBy_Oldest()

Range("A1").Select
Selection.CurrentRegion.Select
Selection.Sort Key1:=Range("A1"), Order1:=xlDescending, Header:=xlGuess,
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End Sub

Mike


"Dan Kraemer" wrote in message
...
I have been told I can sort column A with the "large" command, and have

associated names in column B sort the same way if I select both columns
together and then sort by "large",- but I don't understand how to do this.
Where do I put the command? When do I select the 2 columns? Exactly what
does the command look like? e.g. If ages 10, 20, and 15 are placed in cells
A1, A2, and A3, and names X, Y, and Z are in cells B1, B2, and B3; where do
I put the command and what does it look like, to sort column A in descending
order and keep the same names associated with the ages in the column beside
it? Thank you for your help. Dan




All times are GMT +1. The time now is 12:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com