+ Reply to Thread
Results 1 to 4 of 4

Sorting dataset automatically after entering data in a row [or cel

  1. #1
    MatthewS
    Guest

    Sorting dataset automatically after entering data in a row [or cel



    If I have a spreadsheet with four column, and rows starting at row 2
    [headings are in row 1], and increasing daily.

    One of the columns is a "priority" column, which is 1 [for the highest] down
    to 5 [for lowest].

    I'd like to sort the data each time a new row is entered, such that the
    highest priorities are listed first.

    Is there a way for this to happen automatically? Or would I have to, at the
    least, create a Macro and put that button on the toolbar to press when I want
    a sort to take place?


    Any help would be greatly appreciated.

    Thanks.
    m

    [I apologize that this accidentally went in the FrontPage forum as well...
    sorry about that].

  2. #2
    Ron de Bruin
    Guest

    Re: Sorting dataset automatically after entering data in a row [or cel

    Hi MatthewS

    You can use the change event in the sheet module to sort when you enter a value in column A

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Column = 1 Then
    Range("A:A").Sort Key1:=Range("A2"), Order1:=xlAscending, Header:= _
    xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
    DataOption1:=xlSortNormal
    End If
    End Sub


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl



    "MatthewS" <[email protected]> wrote in message news:[email protected]...
    >
    >
    > If I have a spreadsheet with four column, and rows starting at row 2
    > [headings are in row 1], and increasing daily.
    >
    > One of the columns is a "priority" column, which is 1 [for the highest] down
    > to 5 [for lowest].
    >
    > I'd like to sort the data each time a new row is entered, such that the
    > highest priorities are listed first.
    >
    > Is there a way for this to happen automatically? Or would I have to, at the
    > least, create a Macro and put that button on the toolbar to press when I want
    > a sort to take place?
    >
    >
    > Any help would be greatly appreciated.
    >
    > Thanks.
    > m
    >
    > [I apologize that this accidentally went in the FrontPage forum as well...
    > sorry about that].




  3. #3
    Ron de Bruin
    Guest

    Re: Sorting dataset automatically after entering data in a row [or cel

    Oops

    Change this to your columns

    If your data is in A:Z use

    Range("A:Z").Sort..................................



    --
    Regards Ron de Bruin
    http://www.rondebruin.nl



    "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    > Hi MatthewS
    >
    > You can use the change event in the sheet module to sort when you enter a value in column A
    >
    > Private Sub Worksheet_Change(ByVal Target As Range)
    > If Target.Column = 1 Then
    > Range("A:A").Sort Key1:=Range("A2"), Order1:=xlAscending, Header:= _
    > xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
    > DataOption1:=xlSortNormal
    > End If
    > End Sub
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    >
    > "MatthewS" <[email protected]> wrote in message news:[email protected]...
    >>
    >>
    >> If I have a spreadsheet with four column, and rows starting at row 2
    >> [headings are in row 1], and increasing daily.
    >>
    >> One of the columns is a "priority" column, which is 1 [for the highest] down
    >> to 5 [for lowest].
    >>
    >> I'd like to sort the data each time a new row is entered, such that the
    >> highest priorities are listed first.
    >>
    >> Is there a way for this to happen automatically? Or would I have to, at the
    >> least, create a Macro and put that button on the toolbar to press when I want
    >> a sort to take place?
    >>
    >>
    >> Any help would be greatly appreciated.
    >>
    >> Thanks.
    >> m
    >>
    >> [I apologize that this accidentally went in the FrontPage forum as well...
    >> sorry about that].

    >
    >




  4. #4
    MatthewS
    Guest

    Re: Sorting dataset automatically after entering data in a row [or

    Many thanks... I will give that a shot.

    "Ron de Bruin" wrote:

    > Oops
    >
    > Change this to your columns
    >
    > If your data is in A:Z use
    >
    > Range("A:Z").Sort..................................
    >
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    >
    > "Ron de Bruin" <[email protected]> wrote in message news:[email protected]...
    > > Hi MatthewS
    > >
    > > You can use the change event in the sheet module to sort when you enter a value in column A
    > >
    > > Private Sub Worksheet_Change(ByVal Target As Range)
    > > If Target.Column = 1 Then
    > > Range("A:A").Sort Key1:=Range("A2"), Order1:=xlAscending, Header:= _
    > > xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
    > > DataOption1:=xlSortNormal
    > > End If
    > > End Sub
    > >
    > >
    > > --
    > > Regards Ron de Bruin
    > > http://www.rondebruin.nl
    > >
    > >
    > >
    > > "MatthewS" <[email protected]> wrote in message news:[email protected]...
    > >>
    > >>
    > >> If I have a spreadsheet with four column, and rows starting at row 2
    > >> [headings are in row 1], and increasing daily.
    > >>
    > >> One of the columns is a "priority" column, which is 1 [for the highest] down
    > >> to 5 [for lowest].
    > >>
    > >> I'd like to sort the data each time a new row is entered, such that the
    > >> highest priorities are listed first.
    > >>
    > >> Is there a way for this to happen automatically? Or would I have to, at the
    > >> least, create a Macro and put that button on the toolbar to press when I want
    > >> a sort to take place?
    > >>
    > >>
    > >> Any help would be greatly appreciated.
    > >>
    > >> Thanks.
    > >> m
    > >>
    > >> [I apologize that this accidentally went in the FrontPage forum as well...
    > >> sorry about that].

    > >
    > >

    >
    >
    >


+ 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