+ Reply to Thread
Results 1 to 5 of 5

VBA auto-sort not working when the "IFERROR" part of the formula is in effect

  1. #1
    Forum Contributor
    Join Date
    06-07-2018
    Location
    Newcastle Upon Tyne, England
    MS-Off Ver
    365
    Posts
    143

    VBA auto-sort not working when the "IFERROR" part of the formula is in effect

    I have VBA code to auto-sort a league table.

    My code is:

    Please Login or Register  to view this content.
    The formula in the range column that dictates the sort is:

    Please Login or Register  to view this content.
    The sort works perfectly when the standard part of the formula is able to be used:

    Please Login or Register  to view this content.
    But when there is an error (this is because that particular team have not yet played a fixture so far this season), everything else sorts correctly and all teams that have not yet played and require the =IFERROR are sat at the top of the pile which is causing issues with the other stats in the league table.

    Any suggestions of how I can get the IFERROR teams to be included in the auto-sort? They are displaying the correct value from the formula however, not the correct playing in the league which means other formulas are now referring to the incorrect cells.

    Thanks
    Last edited by davo3286; 04-08-2019 at 02:05 PM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: VBA auto-sort not working when the "IFERROR" part of the formula is in effect

    Try using 0 (no quotes) instead of ".000". When you use ".000" it is interpreted as a string, and won't sort with numbers where you might expect. If you have the cell formatted as number with three decimal places then it will display as 0.000.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    06-07-2018
    Location
    Newcastle Upon Tyne, England
    MS-Off Ver
    365
    Posts
    143

    Re: VBA auto-sort not working when the "IFERROR" part of the formula is in effect

    As always with you Jeff, absolutely SPOT ON! Much appreciated!

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: VBA auto-sort not working when the "IFERROR" part of the formula is in effect

    Glad to help!

    Is that the same Newcastle of Newcastle Ale? I will make it a point to visit one of these days.

  5. #5
    Forum Contributor
    Join Date
    06-07-2018
    Location
    Newcastle Upon Tyne, England
    MS-Off Ver
    365
    Posts
    143

    Re: VBA auto-sort not working when the "IFERROR" part of the formula is in effect

    Yes it certainly is!... And when you do, be sure to get in touch and I will take you for your first!

+ 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. Replies: 3
    Last Post: 03-09-2019, 12:04 PM
  2. What's wrong with my formula =IFERROR('DATA EXPORT - RAW ORDERS'!B1),"")
    By preveo in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-13-2018, 09:26 AM
  3. auto populate "invoice" with part description and price from another sheet if qty=<>0
    By scott33099 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-08-2014, 11:33 AM
  4. [SOLVED] IF Formula not working - need to return "NO" if cell is 1% greater or "YES" if less 1%
    By maryren in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-26-2013, 11:34 AM
  5. [SOLVED] "IF" to "IFERROR" (or other formula) help by skipping empty cells
    By slack578 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-10-2013, 03:50 PM
  6. vba doesn't work with "iferror()" and formula autofill problem
    By lkim in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-10-2012, 07:47 AM
  7. Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)" not working
    By redders in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2011, 03: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