+ Reply to Thread
Results 1 to 11 of 11

Macro Find set criterias to a colomn of number, delete the rows that don't meet criterias

  1. #1
    Forum Contributor
    Join Date
    05-08-2013
    Location
    FLORENCE, ALABAMA
    MS-Off Ver
    Excel 2010
    Posts
    116

    Macro Find set criterias to a colomn of number, delete the rows that don't meet criterias

    Hello Excel Experts,
    I need a macro that will look at column A, number in cell and look for the following criteria:
    1 Column A is the identifier #
    2 Keep the rows with the highest # for the identifier #. Delete the rows that the number is less
    3 keep all the rows that has the word "Tab" (Col E) and Yes (Col I). Delete the rest.

    I would appreciate any help on this. I recorded a macro but my file is very large and it took way too long to run. I know there are easier steps to loop the macro and it would go a lot faster. I just can't find exactly what I need.
    I have attached a file for an example
    Attached Files Attached Files

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Macro Find set criterias to a colomn of number, delete the rows that don't meet criter

    Hi,
    Only ONE row has Tab in E and Yes in I but it's the lowest number
    The highest number is 952 and the other columns do not comply.
    I suggest you include a worksheet with the desired result.
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Forum Contributor
    Join Date
    05-08-2013
    Location
    FLORENCE, ALABAMA
    MS-Off Ver
    Excel 2010
    Posts
    116

    Re: Macro Find set criterias to a colomn of number, delete the rows that don't meet criter

    Hello Keebellah,
    I have the example below the first table. I forgot to mention that on the attachment. Example Table starts at row 5 down to Row 42. The desire results on Table starts at row 47 down to row 66. The highest number to find is in Column C. Column A is just a identifier.

  4. #4
    Forum Contributor
    Join Date
    05-08-2013
    Location
    FLORENCE, ALABAMA
    MS-Off Ver
    Excel 2010
    Posts
    116

    Re: Macro Find set criterias to a colomn of number, delete the rows that don't meet criter

    Hello Keebellah,
    I should have mention that the step numbers are above the columns in row 2. Plus, I didn't not explain the steps clearly on finding the highest number in column C. I am sorry about that.

  5. #5
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Macro Find set criterias to a colomn of number, delete the rows that don't meet criter

    Okay, I saw that table but did not understand it.
    Okay, you have three conditions
    1. Only keep the highest number for each identifier? That means there can be duplicates as goes Identifier and number
    2. Only keep rows that contain Tab in column E and the highest number
    3. Only keep rows that contain Yes in I ans the highest number

    and combinations of all three, is this correct?

  6. #6
    Forum Contributor
    Join Date
    05-08-2013
    Location
    FLORENCE, ALABAMA
    MS-Off Ver
    Excel 2010
    Posts
    116

    Re: Macro Find set criterias to a colomn of number, delete the rows that don't meet criter

    Questions 1. Yes, the identifier could have several rows with the highest number
    Questions 2 & 3. Yes, the rows will have either Yes, Tab or both and will have the highest number in column c that goes with the identifier col a.

  7. #7
    Forum Contributor
    Join Date
    05-08-2013
    Location
    FLORENCE, ALABAMA
    MS-Off Ver
    Excel 2010
    Posts
    116

    Re: Macro Find set criterias to a colomn of number, delete the rows that don't meet criter

    If I could get someone to a least help me do the first part that would be helpful. Have the highest number in Col C for the identifier in column A. Delete the rows that the number is less then the number in col C

  8. #8
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Macro Find set criterias to a colomn of number, delete the rows that don't meet criter

    I can do it, just need the time. It's dinnertime here and we do this to help if and when we can

  9. #9
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Macro Find set criterias to a colomn of number, delete the rows that don't meet criter

    Press Ctrl+Shift+C to run the macro
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    05-08-2013
    Location
    FLORENCE, ALABAMA
    MS-Off Ver
    Excel 2010
    Posts
    116

    Re: Macro Find set criterias to a colomn of number, delete the rows that don't meet criter

    YAY!!! This is exactly what I was hoping for, thank you Keebellah!!! I wasn't trying to push for the help, I was thinking I might have been asking for too much. I know the experts, like yourself, are wonderful to offer to help. This site and others that have helped me in the past have been super awesome! I will mark this task solved. I will also add comments to your reputation. Again, thank so much for the help!!!

  11. #11
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Macro Find set criterias to a colomn of number, delete the rows that don't meet criter

    You're welcome, glad to have been able to do it
    I did not place any comments in the code explaining it, sorry for that.

+ 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. Excel VBA to Delete rows based on multiple criterias
    By mchilapur in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 04-29-2015, 08:41 PM
  2. delete rows based on three criterias
    By cbk40060 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-15-2015, 02:26 PM
  3. Conditional Formula that meet 2 criterias
    By zicitron in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-25-2013, 08:58 AM
  4. [SOLVED] Delete rows based on multiple criterias, copy/paste data and formulas
    By BQuek in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-24-2013, 01:36 PM
  5. Replies: 0
    Last Post: 05-05-2013, 05:47 AM
  6. Using vlookup to get a sales volume but need to meet 2 criterias
    By Vinnie Chan in forum Excel Formulas & Functions
    Replies: 24
    Last Post: 11-07-2008, 05:07 PM
  7. Delete rows based on multiple criterias
    By Benson in forum Excel General
    Replies: 8
    Last Post: 11-02-2005, 06:17 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