Thread: auto sort
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Mike Q. Mike Q. is offline
external usenet poster
 
Posts: 49
Default auto sort

This is probably not the best way, but one way...

Right click on worksheet tab
Select "View Code"
Change (General) to Worksheet
Now enter the following Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Columns("A:A").Sort Key1:=Range("A1"), Order1:=xlAscending, _
Header:=xlGuess,OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End Sub
--
Mike Q.


"jamex" wrote:


Hi all,

Suppose my range A1 to A7 contains following numbers:
before sort After Sort
---------- ----------
7 1
5 2
2 4
8 5
6 6
4 7
1 8
-- If I change 8 as 3 then it should be automatically sorted,
and expected list should be 1 to 7...is it possible?
please.


--
jamex
------------------------------------------------------------------------
jamex's Profile: http://www.excelforum.com/member.php...o&userid=32243
View this thread: http://www.excelforum.com/showthread...hreadid=547434