LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Sorting with worksheet activate

Hi,
Greetings. I have shtPlyrs and shtDraw. The shtPlyrs has ColA Lastname
ColB Firstname and ColC Town. ColD is concatenate of Firstname &
Lastname & Town. ColD is then name ranged as LIST. The LIST is then
used in the shtDraw via data validation with dropdown. The players
are added as the entries are received to the shtPlyrs. However in the
shtDraw the LIST has to be in alpha order by firstname and then
lastname.

Here is my code which I tried with help of macro recorder:
General Module:

Sub proSortByName()
ActiveWorkbook.Worksheets("Plyrs").Sort.SortFields .Clear
ActiveWorkbook.Worksheets("Plyrs").Sort.SortFields .Add Key:=Range
("B10:B80") _
, SortOn:=xlSortOnValues, Order:=xlAscending,
DataOption:=xlSortNormal
ActiveWorkbook.Worksheets("Plyrs").Sort.SortFields .Add Key:=Range
("A10:A80") _
, SortOn:=xlSortOnValues, Order:=xlAscending,
DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Plyrs").Sort
.SetRange Range("A10:C80")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub

In Sheet2 the code:
Private Sub Worksheet_Activate()
Call proSortByName
Sheet2.Range("A3").Select
End Sub

Problem: When I select the shtDraw, I get a partial overlap of the
shtPlyrs details and on debug I notice that the sort selection in
shtPlyrs continues to remain selected. How do I get to deselect the
sort selection so that I can use the dropdown in the cell to choose my
player from an alpha sorted LIST.
Using Vista HP with Excel 2007. Many thks.
Rgds KZ
 
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
trigger worksheet activate event in another worksheet Raj[_2_] Excel Programming 2 June 2nd 08 01:09 PM
Worksheet Activate scott Excel Programming 2 August 13th 07 10:36 PM
Change Worksheet Button Caption on Worksheet.Activate MikeZz Excel Programming 1 December 7th 06 06:01 AM
Activate Previous worksheet after adding a new worksheet [email protected] Excel Programming 3 October 19th 05 01:01 AM
Worksheet.activate Jeff Excel Discussion (Misc queries) 1 December 14th 04 01:52 PM


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

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

About Us

"It's about Microsoft Excel"