ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   sort in EXCEL (https://www.excelbanter.com/excel-worksheet-functions/181331-sort-excel.html)

mats

sort in EXCEL
 
I would like to sort automatically (not manually) the values in 10 different
cells and when the values change the order of the cells automatically
change.....and so on€¦

Do this manually is no worries but€¦.automatically€¦?


Pete_UK

sort in EXCEL
 
Well, you could do it by formulae, or you could have a macro that did
it automatically when one of the values change. Either way, you would
need to give further details if you wanted a more specific answer.

Pete

On Mar 26, 10:13 am, Mats wrote:
I would like to sort automatically (not manually) the values in 10 different
cells and when the values change the order of the cells automatically
change.....and so on...

Do this manually is no worries but....automatically...?



NoodNutt

sort in EXCEL
 
G'day

Open a Module

This code assumes you are sorting one column only, you can add extra Keys to
do additional sorts

Sub AutoSort()
Columns("Your Starting Column": "Your Ending Column").Select 'eg (A:Z)
Range("Your Starting Range":"Your Ending Range").Select 'eg (A1:Z100)
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess,
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("A1").Select
End Sub

In the "Microsoft Excel Object" Section | "ThisWorkbook"

Put this code in.

Private Sub Workbook_Open()
Application.OnTime Now + TimeValue("00:05:00"), "AutoSort"
End Sub

It will AutoSort every 5 mins, or you can change the time value to what
suits you.

HTH
Mark.




mats

sort in EXCEL
 
Hi,
Sorry but I didnt get it.... just one more time,'
e.g.

X has the value of 70
y has the value of 55 ...and so on..

If Y "new" value is 80 the excel sheet should look as follows
(pic2)...Automatically.
-------------------------------------------------------------
A B C D
1 70 x
2 55 y
3 20 z
4
-----------------------------------------
A B C D
1 80 y
2 70 x
3 20 z
4

Any more tips... Rgds //Mats

"NoodNutt" wrote:

G'day

Open a Module

This code assumes you are sorting one column only, you can add extra Keys to
do additional sorts

Sub AutoSort()
Columns("Your Starting Column": "Your Ending Column").Select 'eg (A:Z)
Range("Your Starting Range":"Your Ending Range").Select 'eg (A1:Z100)
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess,
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("A1").Select
End Sub

In the "Microsoft Excel Object" Section | "ThisWorkbook"

Put this code in.

Private Sub Workbook_Open()
Application.OnTime Now + TimeValue("00:05:00"), "AutoSort"
End Sub

It will AutoSort every 5 mins, or you can change the time value to what
suits you.

HTH
Mark.





ilia

sort in EXCEL
 
You can use the functions in the morefunc.xll add-in, which includes
array-based sorting functions.

http://xcell05.free.fr/morefunc/english/index.htm


On Mar 26, 9:23 am, Mats wrote:
Hi,
Sorry but I didn't get it.... just one more time,'
e.g.

X has the value of 70
y has the value of 55 ...and so on..

If Y "new" value is 80 the excel sheet should look as follows
(pic2)...Automatically.
-------------------------------------------------------------
A B C D
1 70 x
2 55 y
3 20 z
4
-----------------------------------------
A B C D
1 80 y
2 70 x
3 20 z
4

Any more tips... Rgds //Mats

"NoodNutt" wrote:
G'day


Open a Module


This code assumes you are sorting one column only, you can add extra Keys to
do additional sorts


Sub AutoSort()
Columns("Your Starting Column": "Your Ending Column").Select 'eg (A:Z)
Range("Your Starting Range":"Your Ending Range").Select 'eg (A1:Z100)
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess,
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("A1").Select
End Sub


In the "Microsoft Excel Object" Section | "ThisWorkbook"


Put this code in.


Private Sub Workbook_Open()
Application.OnTime Now + TimeValue("00:05:00"), "AutoSort"
End Sub


It will AutoSort every 5 mins, or you can change the time value to what
suits you.


HTH
Mark.




All times are GMT +1. The time now is 07:51 AM.

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