+ Reply to Thread
Results 1 to 6 of 6

If statement is false skip to next row

  1. #1
    Registered User
    Join Date
    06-25-2014
    Location
    San Diego, CA
    MS-Off Ver
    14.4.2
    Posts
    3

    If statement is false skip to next row

    Hi everyone,

    Here's my problem. I have a permanent list of part numbers that are hazardous or too large to be shipped (column A on Parts spreadsheet). In column B of the same sheet, I have a column where I will be copying and pasting lists of part numbers along with their make code and on hand quantity. In column E, I am looking to see if there are matches between the two lists. If there is no match, it returns TRUE (which means they are not hazardous or too large to be shipped).

    In the 'Upload List' sheet, I want to take all the part numbers that have a TRUE value (OK to be shipped because they are not too large and are not hazardous). I have a formula that works, but it takes forever to calculate as I have 4,000+ rows this time around and there will be other times where I have upwards of 20,000 part numbers. Also, it is probably not the most efficient way to go about what I am trying to do. I read somewhere that VBA is the way to go, but I'm not really sure how to get started.

    Please help!

    P.S. I only included the first 10 rows (not including the header) for the 'Upload List' sheet of the workbook because it was taking too long for the formulas to calculate and save.

    Upload Parts (version 1).xlsx

  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: If statement is false skip to next row

    Hi, and welcome to the forum.

    VBA code will never be quicker than using standard Excel functions or functionality.

    The correct approach to your requirement is to use the Data Filter Functionality.

    First question is, is it vital to extract those records that have evaluated as True to another sheet. Why not just filter the Parts sheet so that you only see the True Values.

    Then, and only then, if it's vital to have them on another sheet just copy and paste them. You could do all the above with a simple macro which would take seconds.
    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
    Registered User
    Join Date
    06-25-2014
    Location
    San Diego, CA
    MS-Off Ver
    14.4.2
    Posts
    3

    Re: If statement is false skip to next row

    No, it is not vital to extract those records that have evaluated as True to another sheet. They can all stay on the first spreadsheet. Now that I'm thinking about it, I realize how easy it would be just to filter the values that are True. Not sure why I am purposely making it more complicated for myself.

    Would you mind helping me with the simple macro for all of this?

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: If statement is false skip to next row

    The big problem is the references to ENTIRE columns (or almost entire 2:1048576)

    If 20000 records is a realistic limit, then use that, maybe add 10%, 22,000
    Change your named ranges to cover rows 2:22000

    Also, you only need the array formula in column A to get the part number.
    Since the values are unique, you can then do a simple vlookup or Index/Match type of function to get the other 2 columns of data.

    I also removed the INDIRECT reference, and directly named the PartNumber named range in the formula, instead of INDIRECT(A1)

    Here's an example workup.
    EFjmmaldon.xlsx

  5. #5
    Registered User
    Join Date
    06-25-2014
    Location
    San Diego, CA
    MS-Off Ver
    14.4.2
    Posts
    3

    Re: If statement is false skip to next row

    Jonmo1,

    Wow! Thank you. This is amazing. Thank you so much.

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: If statement is false skip to next row

    You're welcome..

    But in hindsite, using plain old Autofilter is probably a much better solution.

+ 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] If statement is false skip to next row
    By jmack549 in forum Excel General
    Replies: 13
    Last Post: 04-16-2015, 07:32 AM
  2. [SOLVED] Skip false rows in If function
    By stevot38 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-13-2013, 04:58 PM
  3. Skip False Statement in If And Function
    By peterpan1279 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-05-2013, 09:31 PM
  4. [SOLVED] How do I Skip a Row if the Value is False
    By coconnor in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-28-2012, 10:26 AM
  5. [SOLVED] If false skip to next
    By irresistible007 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-17-2005, 07:10 AM

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