+ Reply to Thread
Results 1 to 2 of 2

VBA Problems - Written in 365 / Issues on 2010

  1. #1
    Registered User
    Join Date
    10-21-2020
    Location
    Liverpool, UK
    MS-Off Ver
    Office 365
    Posts
    9

    VBA Problems - Written in 365 / Issues on 2010

    Hello,

    Can anybody help me please? I have programmed an extensive workbook, and when transferring to an excel 2010 machine, it is showing an error code with the following line of code:

    ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add2 Key:=Range( _
    "F133:F335"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
    xlSortNormal
    With ActiveWorkbook.Worksheets("Sheet1").Sort
    .SetRange Range("D133:G335")
    .Header = xlGuess
    .MatchCase = False
    .Orientation = xlTopToBottom
    .SortMethod = xlPinYin
    .Apply
    End With

    It was recorded with macro recorder hence the long winded nature.

    Can anybody please help?

    Thanks,

    Craig
    Last edited by CraigStewart; 10-22-2020 at 04:10 PM.

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: VBA Problems - Written in 365 / Issues on 2010

    You need to change the Add2 to Add

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Date formatting issues for textbox values written to worksheet cells
    By Solvax in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-17-2020, 04:43 PM
  2. [SOLVED] Macro written in 2010 doesn't work in 2003
    By Josiah in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-19-2014, 03:40 PM
  3. 17 macro ( VBA ) codes written on MSoffice-2007.Will these work on 2010?
    By PRADEEPB270 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-28-2013, 02:39 AM
  4. Macros Written in Excel 2003 Problems in Excel 2010
    By timbo1957 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-27-2012, 09:01 AM
  5. Excel 2010 to OutLook 2010 Meeting Request Problems
    By tigerdel in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-29-2012, 03:58 AM
  6. [SOLVED] Problem with VBA code written in 2007 and run in 2010
    By kmichae in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-18-2012, 08:18 AM
  7. Excel 2010 Advanced Function Filter problems - 2007 issues
    By adamwestrop in forum Excel General
    Replies: 3
    Last Post: 07-29-2011, 01:52 PM

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.6.0 RC 1