+ Reply to Thread
Results 1 to 5 of 5

Automatic Sort

Hybrid View

  1. #1
    Chris
    Guest

    Automatic Sort

    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/


  2. #2
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    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

  3. #3
    Chris
    Guest

    Re: Automatic Sort

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

    "Carim" wrote:

    >
    > 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
    >
    >
    > --
    > Carim
    > ------------------------------------------------------------------------
    > Carim's Profile: http://www.excelforum.com/member.php...o&userid=33259
    > View this thread: http://www.excelforum.com/showthread...hreadid=532745
    >
    >


  4. #4
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    There are many good sites ...
    One that I particularly love is Chip's :
    http://www.cpearson.com/excel/topic.htm

    It is packed with plenty of tricks ...

    HTH
    Cheers
    Carim

  5. #5
    Chris
    Guest

    Re: Automatic Sort

    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







    "Carim" wrote:

    >
    > There are many good sites ...
    > One that I particularly love is Chip's :
    > http://www.cpearson.com/excel/topic.htm
    >
    > It is packed with plenty of tricks ...
    >
    > HTH
    > Cheers
    > Carim
    >
    >
    >
    > --
    > Carim
    > ------------------------------------------------------------------------
    > Carim's Profile: http://www.excelforum.com/member.php...o&userid=33259
    > View this thread: http://www.excelforum.com/showthread...hreadid=532745
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1