+ Reply to Thread
Results 1 to 5 of 5

Basic Sorting query

  1. #1
    Registered User
    Join Date
    06-11-2006
    Posts
    15

    Basic Sorting query

    Hi, I'm very new to Microsoft Excel, and all I know is primarily self taught, as in my course we focussed on the use of Microsoft Access instead. Anyway, my query is as follows:

    I've made a spreadsheet for the football world cup. I have one sheet with the fixtures in, and one with the groups that take data from the fixtures to make the group tables. My problem with the sorting is as follows:

    Because of the way the groups are done, I've got them sorted firstly by points descendingly, secondly by goal difference, then thirdy by goals scored. When I enter results for the fixtures in the first sheet, it updates the table for results and points, but doesn't update the sorting. I have to go Data - > Sort and press OK again for it to Sort again.

    Is there any way to update Sort automatically?

    Thanks for any help.

  2. #2
    somethinglikeant
    Guest

    Re: Basic Sorting query

    i'd link this to button, so that after you have enterred all your
    scores you can update

    Sub Reordertables()
    Sheets("Sheet2").Activate
    Selection.Sort Key1:=Range("G2"), Order1:=xlDescending,
    Key2:=Range("F2") _
    , Order2:=xlDescending, Header:=xlGuess, OrderCustom:=1,
    MatchCase:= _
    False, Orientation:=xlTopToBottom
    End Sub

    I assume you have more than one table though.
    I'd say record a macro while you perform the task and see what code is
    generated.

    somethinglikeant


    thebottomline wrote:
    > Hi, I'm very new to Microsoft Excel, and all I know is primarily self
    > taught, as in my course we focussed on the use of Microsoft Access
    > instead. Anyway, my query is as follows:
    >
    > I've made a spreadsheet for the football world cup. I have one sheet
    > with the fixtures in, and one with the groups that take data from the
    > fixtures to make the group tables. My problem with the sorting is as
    > follows:
    >
    > Because of the way the groups are done, I've got them sorted firstly by
    > points descendingly, secondly by goal difference, then thirdy by goals
    > scored. When I enter results for the fixtures in the first sheet, it
    > updates the table for results and points, but doesn't update the
    > sorting. I have to go Data - > Sort and press OK again for it to Sort
    > again.
    >
    > Is there any way to update Sort automatically?
    >
    > Thanks for any help.
    >
    >
    > --
    > thebottomline
    > ------------------------------------------------------------------------
    > thebottomline's Profile: http://www.excelforum.com/member.php...o&userid=35290
    > View this thread: http://www.excelforum.com/showthread...hreadid=550780



  3. #3
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Response

    I would suggest using the record macro function to record the manual sorting operation and then copy the code into the worksheet_activate event macro for the second sheet.

    This way, every time you switch to the second sheet, a sort will be done automatically.
    Martin

  4. #4
    Registered User
    Join Date
    06-11-2006
    Posts
    15
    Cheers mrice, that sounds the best way to do it, everytime i go onto the sheet it happens. how would i go about doing that?

  5. #5
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Response

    Use macro-record macro on the tools menu.

    Then paste into the sheet1 tab where you have selected worksheet and activate in the boxes at the top.

+ 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