+ Reply to Thread
Results 1 to 4 of 4

Sort Macro not working

  1. #1
    Registered User
    Join Date
    01-09-2019
    Location
    Toronto Canada
    MS-Off Ver
    Office 10
    Posts
    30

    Sort Macro not working

    Hi….first time posting a question…new to this.
    Been spending hours reading and trying solve a couple of problems and I sure would appreciate some help.
    The Worksheet has a number of “Sort” buttons, all of which are working fine, except one. The “Date”, “Description” and “Action” macro buttons work fine, putting all blank lines to the bottom. The “Symbol” sort button (Column E), for some unknown reason, is putting the blanks at the top. After much playing, I have been able to solve this problem by determining the “LastRow” (constantly changes). I had hoped to combine the row with a static Column (Ai), combining it with the starting cell (A10) for the range to be sorted….it just doesn’t work and, unless I leave the “sort” line out, it gives me the error “COMPILE ERROR: INVALID QUALIFIER”. Seems to be that it doesn’t like “DataRange” being used. If I put in the static range “A10: Ai22” it works. It just doesn’t like the contents of “DataRange” which appears to be the same as the static range mentioned.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Pepe Le Mokko; 04-16-2020 at 02:12 AM. Reason: Code tags added

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,522

    Re: Sort Macro not working

    Please Login or Register  to view this content.
    DataRange is a string, so should be
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-09-2019
    Location
    Toronto Canada
    MS-Off Ver
    Office 10
    Posts
    30

    Re: Sort Macro not working

    Thanks, Jindon....worked like a charm. Such a simple fix and to think I was playing with it for hours! Many, many thanks!!

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

    Re: Sort Macro not working

    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

    I did it for you this time. Please read forum rules. Thanks

+ 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. Need to Sort Column Data - Horizontal Sort Not Working
    By Jadd in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 11-01-2016, 07:09 PM
  2. Print To PDF Macro Sort of Not Working
    By JohnDoh in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-16-2015, 09:20 AM
  3. Sort Macro not working
    By rmingram in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-12-2014, 05:01 PM
  4. Sort macro not working on hidden rows?!
    By Margate in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-15-2013, 12:33 PM
  5. [SOLVED] Record Macro for Custom Sort not Working as I need...
    By LeoThe Lion in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-06-2012, 07:52 AM
  6. Sort Macro not working in 2003 (but ok in 2007)
    By mania112 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-13-2009, 05:23 AM
  7. Sort Macro not working.
    By justforthis1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-24-2009, 08:46 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