+ Reply to Thread
Results 1 to 5 of 5

Incorrect results from sort

  1. #1
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2016
    Posts
    313

    Incorrect results from sort

    I am trying to sort my workbook cells B1:H122 (Row 1 is header). The sort is on column E. I'm running a macro named LOOKUP_PLAYER_DATA. The Macro works as intended until it reaches the sort step:

    Please Login or Register  to view this content.
    I created the sort step using the 'Record Macro' option into a new macro (TEMP) then copied that sort step into the LOOKUP_PLAYER_DATA macro. The sort worked fine when recording the macro and column E was sorted descending properly, however when I run the macro the sort puts rows with spaces or "" before the rows with actual numbers. Even after I replaced the spaces with 0 in E2:E122 I still have rows with spaces before actual numbers??

    I've retried this sequence several times (record new sort macro and retry running it and have gotten same results.

    I've copied the macro to a txt file and attached it but the workbook is too large to upload and I deleted over 3000 rows and 8 columns but the workbook is still to large to load, so I hope someone has an idea to try to fix the issue.

    I set column E cells to Number with no decimal point.


    Thanks for any help you can offer.
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Incorrect results from sort

    Can't you just leave say a hundred rows, some with the spaces and "" stuff and others without. All we need is a representative sample of your data.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2016
    Posts
    313

    Re: Incorrect results from sort

    Hi Richard,

    Yes I finally managed to make a copy and get to a small size.

    I hope this gets to you. When I went to load the new file I had to hit the "Go Advanced" button to see the Manage Attachments options and to get to this screen.

    Thanks,
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2016
    Posts
    313

    Re: Incorrect results from sort

    Richard,

    I forgot to comment out the code in macro LOOKUP_PLAYER_DATA for the example: The problem still exists after commenting the code. Please comment out the following code in that macro - it is at the top of the macro:

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2016
    Posts
    313

    Re: Incorrect results from sort

    Richard, Just an FYI, I no longer have this issue - I had previously done format cells on the sort key column and specified "Number and no decimals", but that had no effect. Then Chenderson gave me a solution for a different problem on the vlookup command and I tried that solution on the sort key and it seems to have resolved the issue.

    FYI, here is the solution: Type one in a blank cell, copy it, and then highlight column "B" (column in question) on the Distribution sheet. Select paste special, then select "Values" and "Multiply".

    Thanks and I'll mark this thread solved

+ 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] Some incorrect results from a formula
    By spittingfire in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-09-2015, 08:25 PM
  2. [SOLVED] Sort macro conflicting with formula to produce incorrect results
    By turtlesrun in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-12-2015, 08:56 AM
  3. [SOLVED] Incorrect results of UDF function
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-29-2014, 06:28 PM
  4. [SOLVED] Incorrect copy/paste results
    By a2b2m2Bb in forum Excel General
    Replies: 5
    Last Post: 08-24-2014, 03:41 PM
  5. Days360 Returns Incorrect Results Sometimes
    By goss in forum Excel General
    Replies: 2
    Last Post: 03-19-2014, 12:57 AM
  6. [SOLVED] Forumula Results Incorrect when data missing. Wanting to hide the incorrect formula.
    By firemedic6265 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-05-2014, 05:01 PM
  7. Sum function returning incorrect results
    By Elena.P in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-16-2013, 01:26 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