PC Review


Reply
Thread Tools Rate Thread

Auto Ranking

 
 
VoxBox-Richard
Guest
Posts: n/a
 
      7th Nov 2008
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 With Quote
 
 
 
 
john
Guest
Posts: n/a
 
      7th Nov 2008
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

 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      7th Nov 2008
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" <(E-Mail Removed)> wrote in message
news:28B3A08A-6DF9-4688-8EFA-(E-Mail Removed)...
>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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Not ranking 0's Darren Microsoft Excel Programming 2 24th Jan 2010 07:59 PM
Auto Ranking a 2x2 table with equal values LiAD Microsoft Excel Worksheet Functions 6 9th Jan 2009 03:26 PM
Help with ranking Stone Microsoft Excel Misc 5 23rd Mar 2008 10:40 PM
Ranking =?Utf-8?B?V2lsbA==?= Microsoft Excel Misc 10 11th Apr 2007 11:04 AM
Ranking =?Utf-8?B?RGF2aWQ=?= Microsoft Access Queries 1 22nd Feb 2004 08:41 PM


Features
 

Advertising
 

Newsgroups
 


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