Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Open Worksheet Sort Data

When I open a worksheet (Refer To CT), I want to automatically sort a named
range by column A in descending order so that blank row are at the bottom.
The named range is "CTReferRecords". Can anyone help me with the code?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Open Worksheet Sort Data

Use the sheet activate event

right click on the sheet and select view code:

Put in code like this

Private Sub Worksheet_Activate()
Dim rng As Range
Set rng = Range("CTReferRecords")
rng.Sort Key1:=rng(1), Order1:=xlAscending, _
Header:=xlYes
End Sub

I open workbooks and activate worksheets, so I may not understand your
situation.

--
Regards,
Tom Ogilvy



"TonyD" wrote:

When I open a worksheet (Refer To CT), I want to automatically sort a named
range by column A in descending order so that blank row are at the bottom.
The named range is "CTReferRecords". Can anyone help me with the code?

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
How to sort data from one worksheet into other worksheets? Andrea Excel Worksheet Functions 1 December 23rd 09 02:16 AM
SORT DATA ON A PROTECTED WORKSHEET! Romileyrunner1 Excel Worksheet Functions 2 September 4th 09 06:56 PM
Run VBA sort when I open worksheet JSnow Excel Discussion (Misc queries) 2 March 18th 09 03:38 PM
Can you sort data on one worksheet into many worksheets? Chiggy Excel Discussion (Misc queries) 4 October 6th 07 03:56 PM
How to sort data into a new worksheet [email protected] Excel Discussion (Misc queries) 1 February 6th 07 11:17 PM


All times are GMT +1. The time now is 10:07 AM.

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"