#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 271
Default sort issue

Here is my code:

Range("A6", Range("G65536").End(xlUp)).Select
Selection.Sort Key1:=Range("G7"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A6").Select


It works fine on my machine. However, when I e-mail this file to other
users, they get an error and the Selection code is highlighted???
--
Thanks
Shawn
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default sort issue

Are you all using the same version of excel?

DataOption1:=xlSortNormal
was added in xl2002.

If your users use earlier versions, remove that parm.

Shawn wrote:

Here is my code:

Range("A6", Range("G65536").End(xlUp)).Select
Selection.Sort Key1:=Range("G7"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A6").Select

It works fine on my machine. However, when I e-mail this file to other
users, they get an error and the Selection code is highlighted???
--
Thanks
Shawn


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 271
Default sort issue

If I remove: , _
DataOption1:=xlSortNormal
it will work in any version?

--
Thanks
Shawn


"Dave Peterson" wrote:

Are you all using the same version of excel?

DataOption1:=xlSortNormal
was added in xl2002.

If your users use earlier versions, remove that parm.

Shawn wrote:

Here is my code:

Range("A6", Range("G65536").End(xlUp)).Select
Selection.Sort Key1:=Range("G7"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A6").Select

It works fine on my machine. However, when I e-mail this file to other
users, they get an error and the Selection code is highlighted???
--
Thanks
Shawn


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default sort issue

That's the default for xl2002+, so it should.

Shawn wrote:

If I remove: , _
DataOption1:=xlSortNormal
it will work in any version?

--
Thanks
Shawn

"Dave Peterson" wrote:

Are you all using the same version of excel?

DataOption1:=xlSortNormal
was added in xl2002.

If your users use earlier versions, remove that parm.

Shawn wrote:

Here is my code:

Range("A6", Range("G65536").End(xlUp)).Select
Selection.Sort Key1:=Range("G7"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A6").Select

It works fine on my machine. However, when I e-mail this file to other
users, they get an error and the Selection code is highlighted???
--
Thanks
Shawn


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default sort issue

Hi Shawn,

If your user has abn earlier version (xl2k?) then:

DataOption1:=xlSortNormal

would cause a problem as this argument would not be recognised.

When writing an application, it is important to develop using oldest version
of Excel likely to be encountered.


---
Regards,
Norman



"Shawn" wrote in message
...
Here is my code:

Range("A6", Range("G65536").End(xlUp)).Select
Selection.Sort Key1:=Range("G7"), Order1:=xlDescending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A6").Select


It works fine on my machine. However, when I e-mail this file to other
users, they get an error and the Selection code is highlighted???
--
Thanks
Shawn





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 271
Default sort issue

How should I write that code?

There error is: "Compile error, variable not defined"
--
Thanks
Shawn


"Norman Jones" wrote:

Hi Shawn,

If your user has abn earlier version (xl2k?) then:

DataOption1:=xlSortNormal

would cause a problem as this argument would not be recognised.

When writing an application, it is important to develop using oldest version
of Excel likely to be encountered.


---
Regards,
Norman



"Shawn" wrote in message
...
Here is my code:

Range("A6", Range("G65536").End(xlUp)).Select
Selection.Sort Key1:=Range("G7"), Order1:=xlDescending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A6").Select


It works fine on my machine. However, when I e-mail this file to other
users, they get an error and the Selection code is highlighted???
--
Thanks
Shawn




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default sort issue

Hi Shawn,

As suggested By Dave in his adjacent post, delete the contentious parameter:

Selection.Sort Key1:=Range("G7"), _
Order1:=xlDescending, _
Header:=xlGuess, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom

---
Regards,
Norman



"Shawn" wrote in message
...
How should I write that code?

There error is: "Compile error, variable not defined"
--
Thanks
Shawn


"Norman Jones" wrote:

Hi Shawn,

If your user has abn earlier version (xl2k?) then:

DataOption1:=xlSortNormal

would cause a problem as this argument would not be recognised.

When writing an application, it is important to develop using oldest
version
of Excel likely to be encountered.


---
Regards,
Norman



"Shawn" wrote in message
...
Here is my code:

Range("A6", Range("G65536").End(xlUp)).Select
Selection.Sort Key1:=Range("G7"), Order1:=xlDescending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A6").Select


It works fine on my machine. However, when I e-mail this file to other
users, they get an error and the Selection code is highlighted???
--
Thanks
Shawn






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 271
Default sort issue

Is that causing, "compile error, variable not defined?"
--
Thanks
Shawn


"Norman Jones" wrote:

Hi Shawn,

As suggested By Dave in his adjacent post, delete the contentious parameter:

Selection.Sort Key1:=Range("G7"), _
Order1:=xlDescending, _
Header:=xlGuess, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom

---
Regards,
Norman



"Shawn" wrote in message
...
How should I write that code?

There error is: "Compile error, variable not defined"
--
Thanks
Shawn


"Norman Jones" wrote:

Hi Shawn,

If your user has abn earlier version (xl2k?) then:

DataOption1:=xlSortNormal

would cause a problem as this argument would not be recognised.

When writing an application, it is important to develop using oldest
version
of Excel likely to be encountered.


---
Regards,
Norman



"Shawn" wrote in message
...
Here is my code:

Range("A6", Range("G65536").End(xlUp)).Select
Selection.Sort Key1:=Range("G7"), Order1:=xlDescending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A6").Select


It works fine on my machine. However, when I e-mail this file to other
users, they get an error and the Selection code is highlighted???
--
Thanks
Shawn






  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default sort issue

Hi Shawn,

Yes - in versions prior to xl2002.

---
Regards,
Norman



"Shawn" wrote in message
...
Is that causing, "compile error, variable not defined?"
--
Thanks
Shawn


"Norman Jones" wrote:

Hi Shawn,

As suggested By Dave in his adjacent post, delete the contentious
parameter:

Selection.Sort Key1:=Range("G7"), _
Order1:=xlDescending, _
Header:=xlGuess, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom

---
Regards,
Norman



"Shawn" wrote in message
...
How should I write that code?

There error is: "Compile error, variable not defined"
--
Thanks
Shawn


"Norman Jones" wrote:

Hi Shawn,

If your user has abn earlier version (xl2k?) then:

DataOption1:=xlSortNormal

would cause a problem as this argument would not be recognised.

When writing an application, it is important to develop using oldest
version
of Excel likely to be encountered.


---
Regards,
Norman



"Shawn" wrote in message
...
Here is my code:

Range("A6", Range("G65536").End(xlUp)).Select
Selection.Sort Key1:=Range("G7"), Order1:=xlDescending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom,
_
DataOption1:=xlSortNormal
Range("A6").Select


It works fine on my machine. However, when I e-mail this file to
other
users, they get an error and the Selection code is highlighted???
--
Thanks
Shawn








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
Sort Issue Texins Karate Excel Discussion (Misc queries) 2 December 14th 09 06:16 PM
SORT/FILTER ISSUE Munfarid Excel Worksheet Functions 4 September 11th 09 03:54 AM
Lookup and sort issue Struggling in Sheffield[_2_] New Users to Excel 2 July 16th 09 06:00 PM
Sort issue Patrick C. Simonds Excel Worksheet Functions 1 December 30th 07 11:37 AM
Sort issue Patty[_2_] Excel Programming 9 December 12th 03 09:47 PM


All times are GMT +1. The time now is 09:35 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"