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

Any idea why the following runs on laptop with XL 2002 but not on desktop
with XL 2000.

It is in a subroutine called by another. The sub does not start but throws
up the comment 'Named argument cannot be found' and 'DataOption1' is
highlighted?



Range("A1:D" & iCount).Sort Key1:=Range("C1"), Order1:=xlAscending,
Header:=xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, DataOption1:=xlSortNormal



Francis Hookham


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Sorting problem

Remove this portion: ", DataOption1:=xlSortNormal"

This option was added in xl2002.

Francis Hookham wrote:

Any idea why the following runs on laptop with XL 2002 but not on desktop
with XL 2000.

It is in a subroutine called by another. The sub does not start but throws
up the comment 'Named argument cannot be found' and 'DataOption1' is
highlighted?

Range("A1:D" & iCount).Sort Key1:=Range("C1"), Order1:=xlAscending,
Header:=xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, DataOption1:=xlSortNormal

Francis Hookham


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Sorting problem

Francis,

The 'DataOption1' sort option was added with Excel 2002. It is not
recognized by earlier versions. When you are working with multiple versions
of Excel, you must be sure you code for the earliest version. Otherwise, as
you have seen, the code may not work.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"Francis Hookham" wrote in message
...
Any idea why the following runs on laptop with XL 2002 but not on desktop
with XL 2000.

It is in a subroutine called by another. The sub does not start but throws
up the comment 'Named argument cannot be found' and 'DataOption1' is
highlighted?



Range("A1:D" & iCount).Sort Key1:=Range("C1"), Order1:=xlAscending,
Header:=xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, DataOption1:=xlSortNormal



Francis Hookham



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 125
Default Sorting problem

Many thanks Chip and Dave

I do most of the programming in 2002 on the Laptop (it is newer and much
faster!) but, now I understand the problem I'll remove similar offending
code if it occurs and chack the macro still runs correctly.

Francis


"Chip Pearson" wrote in message
...
Francis,

The 'DataOption1' sort option was added with Excel 2002. It is not
recognized by earlier versions. When you are working with multiple
versions of Excel, you must be sure you code for the earliest version.
Otherwise, as you have seen, the code may not work.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"Francis Hookham" wrote in message
...
Any idea why the following runs on laptop with XL 2002 but not on desktop
with XL 2000.

It is in a subroutine called by another. The sub does not start but
throws up the comment 'Named argument cannot be found' and 'DataOption1'
is highlighted?



Range("A1:D" & iCount).Sort Key1:=Range("C1"), Order1:=xlAscending,
Header:=xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, DataOption1:=xlSortNormal



Francis Hookham





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
Sorting VBA problem wynand Excel Discussion (Misc queries) 6 February 7th 08 06:38 PM
sorting problem Orion[_2_] Excel Programming 5 March 9th 05 11:58 AM
Sorting problem Chris Excel Worksheet Functions 1 November 3rd 04 11:27 PM
Sorting problem elayem[_2_] Excel Programming 0 October 15th 04 07:46 PM
Sorting problem elayem Excel Programming 2 October 15th 04 07:19 PM


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

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"