Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 ... 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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 ... 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Dynamic Ranges: Speed Issue | Excel Worksheet Functions | |||
using LOOKUP instead of IF on dynamic row | Excel Worksheet Functions | |||
Can't create dynamic charts | Charts and Charting in Excel | |||
Dynamic charting problems (events) | Charts and Charting in Excel | |||
Indirect and dynamic ranges | Excel Worksheet Functions |