If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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" wrote in message news 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
|
|||
|
|||
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" wrote in message news 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 |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
dynamic sorting in reports | [email protected] | Setting Up & Running Reports | 1 | December 1st, 2005 11:46 PM |
Can't create dynamic charts | Brian Sells | Charts and Charting | 7 | March 22nd, 2005 04:23 AM |
Sorting a table by concatenating several fields in the same table | salsaguy | Running & Setting Up Queries | 3 | March 6th, 2005 08:41 PM |
Sorting a table by concatenating several fields in the same table | salsaguy | Running & Setting Up Queries | 0 | March 6th, 2005 01:33 AM |
Sorting in Dynamic PivotTable | plumstone | General Discussion | 2 | July 31st, 2004 09:49 PM |