Automatic Sort

C

Chris

OK... I have a schedule file that gets updated hourly by non-excel type
people. I want the spreadsheet to sort by column N every time a change,
addition, deletion of anything is done to the spreadsheet... how do I go
about doing this/
 
C

Carim

Hi Chris,

With an event macro stored in the worksheet module :
Private Sub Worksheet_Calculate()
' Adjust to Your Range
Selection.Sort Key1:=Range("YourCell"), Order1:=Ord,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End Sub

HTH
Cheers
Carim
 
C

Chris

Great... last question... where do I learn this stuff.... I'm an access
programmer but this is a little different...
 
C

Chris

How do I adjust the range... I want the range to sort by column C... I tried


Private Sub Worksheet_Calculate()
Selection.Sort Key1:=Range("C"), Order1:=Ord,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End Sub

I also tried:
Private Sub Worksheet_Calculate()
Selection.Sort Key1:=Range("C2,C300"), Order1:=Ord,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End Sub

I also tried:
Private Sub Worksheet_Calculate()
Selection.Sort Key1:=Range("C2:C300"), Order1:=Ord,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End Sub
 
Top