+ Reply to Thread
Results 1 to 2 of 2

Deleting entire rows using conditions related to column A and B

  1. #1
    Registered User
    Join Date
    05-03-2019
    Location
    Texas, USA
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    6

    Deleting entire rows using conditions related to column A and B

    I have a list of 55K rows and 20 columns. The list consists of names, dates, other identifying info. I've attached a workbook showing a small hypothetical example.

    The following assumes that you are looking at the workbook.

    For this example I want to keep only one row per person. The row that will be chosen for an individual person will be based on the date of service variable. I need to only keep the row with the most recent date of service and delete all the rest of the rows for that individual.


    I provided an example of what I would like the table to turn into.


    Potential Solution I've thought about (just don't know how to write the code):

    Step 1. Turn the dates into numbers

    Step 2. Write a VBA code that searches for name ID matches within column "A" then for every match it searches the adjacent cell in column "B". If the value of the cell in column "B" is the highest out of all other matches, delete all other rows with the individuals name ID and leave just the most recent.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    07-21-2019
    Location
    Italy
    MS-Off Ver
    2016
    Posts
    58

    Re: Deleting entire rows using conditions related to column A and B

    Hi,
    try this:
    Please Login or Register  to view this content.

+ 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. Problem Deleting Entire Rows
    By CaptMac in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-17-2014, 01:39 PM
  2. [SOLVED] Moving row to column conditions, deleting rows
    By rocketpanda in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-17-2014, 04:36 AM
  3. Deleting entire rows when a cell in that row contains #N/A
    By colin.dickson in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-15-2012, 10:13 AM
  4. VBA for deleting entire rows
    By TheTalentedMrRipley in forum Excel General
    Replies: 3
    Last Post: 11-04-2010, 07:31 PM
  5. Deleting rows based on max value in entire row
    By form in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-27-2010, 09:27 AM
  6. Replies: 3
    Last Post: 01-11-2006, 03:15 PM
  7. Deleting Entire Rows
    By gavsta in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-19-2005, 12:45 AM

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