+ Reply to Thread
Results 1 to 2 of 2

Thread: Macros: 2007 and 1997-2003 incompatibility

  1. #1
    Registered User
    Join Date
    01-08-2008
    Posts
    14

    Macros: 2007 and 1997-2003 incompatibility

    I've just found that the macros I recorded in 2007 for a simple data sort, i.e. highlight some cells and data sort, do not run when the spreadsheet is opened in Excel 1997-2003 after the original had been saved in the old format.There was a warning about slight loss of quality due to formatting but nothing else. Is there a simple way around this or do I have to rerecord all the macros in the old version?

    Macros code for the sort is typically this:-

    Sub Macro2()
    '
    ' Macro2 Macro
    '
    
    '
        Range("M13:N18").Select
        ActiveWorkbook.Worksheets("FM I-O (B)").Sort.SortFields.Clear
        ActiveWorkbook.Worksheets("FM I-O (B)").Sort.SortFields.Add Key:=Range( _
            "M13:M18"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
            xlSortNormal
        With ActiveWorkbook.Worksheets("FM I-O (B)").Sort
            .SetRange Range("M13:N18")
            .Header = xlGuess
            .MatchCase = False
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
            .Apply
        End With
    End Sub
    Last edited by lemonstar; 02-21-2009 at 12:07 PM. Reason: Include code snippet

  2. #2
    Forum Guru VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    12,010

    Re: Macros: 2007 and 1997-2003 incompatibility

    Your post does not comply with Rule 5 of our Forum RULES. We have Seven question forums: Miscellaneous, General, Programming, Worksheet Functions, Charting, Excel 2007 Help and New Users. Please choose the appropriate forum, and post your question in ONLY one forum.

    Move to programming.

    SortFields
    is a xl 2007 command I believe. Best to make the macro's in xl 03 whenever possible

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.2.0