sort in EXCEL

  • Thread starter Thread starter Mats
  • Start date Start date
M

Mats

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…?
 
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
 
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.
 
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
 
Back
Top