+ Reply to Thread
Results 1 to 5 of 5

VBA in 2007 v 2003

  1. #1
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    804

    VBA in 2007 v 2003

    Can anyone advise me why the line

    ActiveWorkbook.Worksheets(CurrentWorksheet).Sort.SortFields.Clear

    from the code below works fine in Exccel 2007 but falls over in 2003, and is there a workaround?


    Please Login or Register  to view this content.
    Thanks for any help
    Last edited by rylo; 01-16-2009 at 02:53 AM. Reason: add code tags

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202
    I think SortFields only applies to 2007
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    804
    thank you - I think you're right

    IS there a 2003 equivalent?

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202
    I hink you can just use Sort, test for version using application.version to determine which code to run.

  5. #5
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    804

    Thanks

    Thanks, Roy. I eventually found it after about ten hours - I must do a course in VBA because hacking through a problem all the time is not the way to go about it...

    Thanks for your help

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1