automatically sort

Jadre

New member
Joined
Mar 3, 2014
Messages
3
Reaction score
0
Points
0
Location
Manitoba, Canada
i am trying to automatically sort values when a cell in the range A1:A10 changes

the range is A1:A10 how do u make it sort automatically when a cell changes in that range using a macro or formula
 
Copy the below code and do right click on sheet tab and select view code and paste it. Close the VBA window (Alt+Q to close VBA window) and return to that sheet and check.

Code:
[color=darkblue]Private[/color] [color=darkblue]Sub[/color] Worksheet_Change([color=darkblue]ByVal[/color] Target [color=darkblue]As[/color] Range)

[color=darkblue]If[/color] [color=darkblue]Not[/color] Intersect(Target, Range("A1:A10")) [color=darkblue]Is[/color] [color=darkblue]Nothing[/color] [color=darkblue]Then[/color]
    Application.ScreenUpdating = [color=darkblue]False[/color]
        Range("A1:A10").Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlNo
    Application.ScreenUpdating = [color=darkblue]True[/color]
[color=darkblue]End[/color] [color=darkblue]If[/color]

End [color=darkblue]Sub[/color]
 
i tried your macro and it sorts them but not automatically do u know a macro to sort them auto?
 
Back
Top