Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2006

Tip: Looking for answers? Try searching our database.

sort issue

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Shawn - 15 Sep 2005 14:55 GMT
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???
Signature

Thanks
Shawn

Dave Peterson - 15 Sep 2005 15:01 GMT
Are you all using the same version of excel?

DataOption1:=xlSortNormal
was added in xl2002.

If your users use earlier versions, remove that parm.

> Here is my code:
>
[quoted text clipped - 9 lines]
> Thanks
> Shawn

Signature

Dave Peterson

Shawn - 15 Sep 2005 15:45 GMT
If I remove: , _
        DataOption1:=xlSortNormal
it will work in any version?

Signature

Thanks
Shawn

> Are you all using the same version of excel?
>
[quoted text clipped - 16 lines]
> > Thanks
> > Shawn
Dave Peterson - 15 Sep 2005 21:41 GMT
That's the default for xl2002+, so it should.

> If I remove: , _
>          DataOption1:=xlSortNormal
[quoted text clipped - 28 lines]
> >
> > Dave Peterson

Signature

Dave Peterson

Norman Jones - 15 Sep 2005 15:06 GMT
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

> Here is my code:
>
[quoted text clipped - 7 lines]
> 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???
Shawn - 15 Sep 2005 15:27 GMT
How should I write that code?

There error is: "Compile error, variable not defined"
Signature

Thanks
Shawn

> Hi Shawn,
>
[quoted text clipped - 22 lines]
> > 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???
Norman Jones - 15 Sep 2005 15:51 GMT
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

> How should I write that code?
>
[quoted text clipped - 27 lines]
>> > 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???
Shawn - 15 Sep 2005 16:02 GMT
Is that causing, "compile error, variable not defined?"
Signature

Thanks
Shawn

> Hi Shawn,
>
[quoted text clipped - 42 lines]
> >> > 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???
Norman Jones - 15 Sep 2005 16:54 GMT
Hi Shawn,

Yes - in versions prior to xl2002.

---
Regards,
Norman

> Is that causing, "compile error, variable not defined?"
>
[quoted text clipped - 47 lines]
>> >> > other
>> >> > users, they get an error and the Selection code is highlighted???
sbweid - 23 Sep 2006 18:56 GMT
I have a variation on this problem.  I'm using Excel 2002 sp3.  The VBA code
is quite simple.

   Application.Goto Reference:=SubAcctDB ' where this variable is set to a
defined named range
   Selection.Sort Key1:=Range("BA14"), Order1:=xlAscending, Header:=xlNo, _
       OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
       DataOption1:=xlSortNormal

The result is the following:
Compile Error: Mehtod or data member not found.

I'm totally lost since I have done these kinds of sorts 50 times.  Can you
help me with this?

Thanks!

Steve
Signature

sbw

> Hi Shawn,
>
[quoted text clipped - 55 lines]
> >> >> > other
> >> >> > users, they get an error and the Selection code is highlighted???
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.