+ Reply to Thread
Results 1 to 3 of 3

Sort Ascending order not working - VBA

  1. #1
    Forum Contributor
    Join Date
    12-18-2011
    Location
    long island
    MS-Off Ver
    365
    Posts
    236

    Sort Ascending order not working - VBA

    Hello,
    I have the following code:
    Please Login or Register  to view this content.
    No errors when running the macro. Everything works except this section:
    Please Login or Register  to view this content.
    I'm trying to sort the sheet by column "I" ascending, but instead nothing happens. Not sure what I'm doing wrong.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Sort Ascending order not working - VBA

    Your sort code just sets the sort field. It does not apply it. Use this line to apply the sort
    Please Login or Register  to view this content.
    Or use this syntax to set and apply all in one line of code...
    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    12-18-2011
    Location
    long island
    MS-Off Ver
    365
    Posts
    236

    Re: Sort Ascending order not working - VBA

    Thanks AlphaFrog,
    wks.sort.apply isn't working for some reason. The other line of code works sometimes and other times I'm getting an error stating, "The sort reference is not valid. Make sure it's within the data want to sort, and the first sort box isn't the same or blank."

+ 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] Sort in ascending order with same mark
    By kent97 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-05-2016, 08:55 AM
  2. Sort the final digits and sort in ascending order
    By jorel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-29-2014, 11:58 AM
  3. Date sort in ascending order not working
    By mukeshbaviskar in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-14-2014, 11:06 PM
  4. [SOLVED] Sort in ascending order
    By Glenn Kennedy in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-07-2013, 08:11 AM
  5. [SOLVED] Sort Ascending order
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-16-2013, 02:27 PM
  6. [SOLVED] Sort in ascending order
    By Dibbley247 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-17-2013, 12:30 AM
  7. sort ascending order
    By iscar_marius in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 02-11-2009, 11:00 AM

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