+ Reply to Thread
Results 1 to 2 of 2

Sorting data in a master sheet

  1. #1
    Graham Mason
    Guest

    Sorting data in a master sheet

    I have a Workbook with a number of worksheets linked to a master sheet at
    the front. If any data changes in any of the worksheets, I would like to
    sort automatically on the master sheet, i.e. if a date changes I would like
    to sort the dates in their new order. Can this be done?
    Using Excel 2003



  2. #2
    JMB
    Guest

    RE: Sorting data in a master sheet

    you could right click the master sheet tab, select view code, and paste the
    following into the code table.

    Private Sub Worksheet_Calculate()
    Sheet1.Columns("A:A").Sort Key1:=Range("A1"), Order1:=xlAscending,
    Header:=xlGuess, _
    OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
    End Sub

    The range to be sorted (Sheet1.Columns("A:A")) will need to be changed
    depending on the dimensions of your table (Sheet1.Range("A1:H50") - for
    example). Also, you'll need to change the Key range. If your table
    dimensions are dynamic, you'll likely not want to hardcode the range to be
    sorted.


    "Graham Mason" wrote:

    > I have a Workbook with a number of worksheets linked to a master sheet at
    > the front. If any data changes in any of the worksheets, I would like to
    > sort automatically on the master sheet, i.e. if a date changes I would like
    > to sort the dates in their new order. Can this be done?
    > Using Excel 2003
    >
    >
    >


+ 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