Thread: Sorting code
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Shailesh Shah[_2_] Shailesh Shah[_2_] is offline
external usenet poster
 
Posts: 114
Default Sorting code

Try this,
Put below code to your worksheet's code module.

Private Sub Worksheet_Calculate()
Range("b1").CurrentRegion.Sort Key1:=Range("b1"), Order1:=xlAscending,
Header:=xlNo _
, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom,
_
DataOption1:=xlSortNormal
End Sub



Regards,
Shah Shailesh
http://in.geocities.com/shahshaileshs/
(Excel Add-ins Page)

*** Sent via Developersdex http://www.developersdex.com ***