#1   Report Post  
Posted to microsoft.public.excel.misc
Dr. Sachin Wagh
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Dr. Sachin Wagh
 
Posts: n/a
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Ranges: Speed Issue Sige Excel Worksheet Functions 5 December 12th 05 09:28 PM
using LOOKUP instead of IF on dynamic row Jay C Excel Worksheet Functions 0 April 8th 05 12:56 PM
Can't create dynamic charts Brian Sells Charts and Charting in Excel 7 March 22nd 05 04:23 AM
Dynamic charting problems (events) [email protected] Charts and Charting in Excel 4 January 27th 05 09:32 PM
Indirect and dynamic ranges Sam Excel Worksheet Functions 3 January 24th 05 07:01 AM


All times are GMT +1. The time now is 12:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"