A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Dynamic Sorting



 
 
Thread Tools Display Modes
  #1  
Old December 5th, 2005, 10:10 AM posted to microsoft.public.excel.misc
external usenet poster
 
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  
Old December 5th, 2005, 10:21 AM posted to microsoft.public.excel.misc
external usenet poster
 
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
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  
Old December 5th, 2005, 11:04 AM posted to microsoft.public.excel.misc
external usenet poster
 
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
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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 05:50 PM.


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