Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Auto Ranking

I have written some code to sort some data every time its sheet is open. My
code is working fine in 2007, but I am getting errors in 2000.

Can some one look through and give me some pointers.

Thank you.
R.

Code:

Private Sub Worksheet_Activate()

Range("B13").CurrentRegion.sort Key1:=Range("B13"), _
Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=True, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Auto Ranking

I think the problems is this line "DataOption1:=xlSortNormal" it's not
compatibal with xl2k. Try removing it!
--
jb


"VoxBox-Richard" wrote:

I have written some code to sort some data every time its sheet is open. My
code is working fine in 2007, but I am getting errors in 2000.

Can some one look through and give me some pointers.

Thank you.
R.

Code:

Private Sub Worksheet_Activate()

Range("B13").CurrentRegion.sort Key1:=Range("B13"), _
Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=True, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Auto Ranking

As John says DataOption1 is n/a in xl2000. Following should work in all
versions

Dim oRng As Object ' don't change to as range !

Set oRng = Range("B13")
If Val(Application.Version) <= 10 Then
oRng.CurrentRegion.Sort Key1:=Range("B13"), _
Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=True, Orientation:=xlTopToBottom
Else
oRng.CurrentRegion.Sort Key1:=Range("B13"), _
Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=True, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End If

Regards,
Peter T

"VoxBox-Richard" wrote in message
...
I have written some code to sort some data every time its sheet is open.
My
code is working fine in 2007, but I am getting errors in 2000.

Can some one look through and give me some pointers.

Thank you.
R.

Code:

Private Sub Worksheet_Activate()

Range("B13").CurrentRegion.sort Key1:=Range("B13"), _
Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=True, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

End Sub




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
ranking liem Excel Worksheet Functions 1 May 28th 10 08:39 PM
Auto Ranking a 2x2 table with equal values LiAD Excel Worksheet Functions 6 January 9th 09 03:26 PM
Top 10 Ranking again louiscourtney Excel Discussion (Misc queries) 0 July 19th 07 04:36 PM
Top 10 Ranking louiscourtney Excel Discussion (Misc queries) 10 July 19th 07 03:28 PM
Ranking jtothet21 Excel Discussion (Misc queries) 1 May 21st 05 03:35 AM


All times are GMT +1. The time now is 04:30 PM.

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"