+ Reply to Thread
Results 1 to 3 of 3

Dynamic Sorting

  1. #1
    Dr. Sachin Wagh
    Guest

    Dynamic Sorting

    Sheet 2 has 20 rows (Column 1 - Heading & Column 2 - Total). This is linked
    to Sheet 1 (thru vlookup).
    I need to have these 20 rows sorted (Cloumn 2) in ascending manner, as the
    figures of sheet 1 are changed. Is that possible?
    --
    Dr. Sachin Wagh
    MBBS, DHA, DPH

  2. #2
    Bob Phillips
    Guest

    Re: Dynamic Sorting

    Select the sheet2 worksheet, and then add this code

    Option Explicit

    Private Sub Worksheet_Calculate()

    Me.Range("A1:B20").Sort key1:=Me.Range("B1"), header:=xlYes

    ws_exit:
    Application.EnableEvents = True
    End Sub

    'This is worksheet event code, which means that it needs to be
    'placed in the appropriate worksheet code module, not a standard
    'code module. To do this, right-click on the sheet tab, select
    'the View Code option from the menu, and paste the code in.



    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Dr. Sachin Wagh" <[email protected]> wrote in message
    news:[email protected]...
    > Sheet 2 has 20 rows (Column 1 - Heading & Column 2 - Total). This is

    linked
    > to Sheet 1 (thru vlookup).
    > I need to have these 20 rows sorted (Cloumn 2) in ascending manner, as the
    > figures of sheet 1 are changed. Is that possible?
    > --
    > Dr. Sachin Wagh
    > MBBS, DHA, DPH




  3. #3
    Dr. Sachin Wagh
    Guest

    Re: Dynamic Sorting

    Works wonders, Thanx a Ton

    --
    Dr. Sachin Wagh
    MBBS, DHA, DPH


    "Bob Phillips" wrote:

    > Select the sheet2 worksheet, and then add this code
    >
    > Option Explicit
    >
    > Private Sub Worksheet_Calculate()
    >
    > Me.Range("A1:B20").Sort key1:=Me.Range("B1"), header:=xlYes
    >
    > ws_exit:
    > Application.EnableEvents = True
    > End Sub
    >
    > 'This is worksheet event code, which means that it needs to be
    > 'placed in the appropriate worksheet code module, not a standard
    > 'code module. To do this, right-click on the sheet tab, select
    > 'the View Code option from the menu, and paste the code in.
    >
    >
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "Dr. Sachin Wagh" <[email protected]> wrote in message
    > news:[email protected]...
    > > Sheet 2 has 20 rows (Column 1 - Heading & Column 2 - Total). This is

    > linked
    > > to Sheet 1 (thru vlookup).
    > > I need to have these 20 rows sorted (Cloumn 2) in ascending manner, as the
    > > figures of sheet 1 are changed. Is that possible?
    > > --
    > > Dr. Sachin Wagh
    > > MBBS, DHA, DPH

    >
    >
    >


+ 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