+ Reply to Thread
Results 1 to 2 of 2

Unable to sort data column with header into Ascending/ Descending order [Run-time error ']

  1. #1
    Registered User
    Join Date
    03-10-2020
    Location
    Hong kong
    MS-Off Ver
    MAC 2008
    Posts
    25

    Lightbulb Unable to sort data column with header into Ascending/ Descending order [Run-time error ']

    Sub ReturnSales()
    '

    '
    ActiveWorkbook.Worksheets("AppleSales").ListObjects("Table1").Sort.SortFields. _
    Clear
    ActiveWorkbook.Worksheets("ApplesSales").ListObjects("Table1").Sort.SortFields. _
    Add2 Key:=Range("Table1[[#All],[2017 Sales]]"), SortOn:=xlSortOnValues, _
    Order:=xlDescending, DataOption:=xlSortNormal
    With ActiveWorkbook.Worksheets("AppleSales").ListObjects("Table1").Sort
    .Header = xlYes
    .MatchCase = False
    .Orientation = xlTopToBottom
    .SortMethod = xlPinYin
    .Apply
    End With
    End Sub


    The code above says the object does not support this property or method? What does that mean?

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,463

    Re: Unable to sort data column with header into Ascending/ Descending order [Run-time erro

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)

+ 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. Sort Data in ascending order from an Alphanumeric column
    By jheiler1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-22-2021, 09:24 AM
  2. VBA Code to sort in ascending AND descending order
    By infinitecables in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-07-2017, 11:10 AM
  3. [SOLVED] Find column location by header and then sort rows below it be ascending order
    By Boo123 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-04-2015, 11:58 AM
  4. If Function To Sort Column Ascending/Descending Excel VBA
    By FLani in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-29-2013, 04:10 AM
  5. macro to sort in ascending/descending order
    By apio in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-21-2012, 02:46 AM
  6. Can you sort a chart out in Ascending/Descending Order
    By dandavis1 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 11-26-2010, 09:52 AM
  7. one macro to sort text in ascending and descending order
    By jpruffle in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-13-2008, 10:24 PM

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