Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

find matching data and remove

Posted on 2014-09-16
2
89 Views
Last Modified: 2014-09-16
I have attached a file that will make clear what I am looking for but briefly I need vba code that will remove rows under the below criteria.

When Ref Type (column c) contains both ABCD and WXYZ for a matching Dept (column K) and  xd same [Column D] - remove ABCD event and keep WXYZ only.

The VBA needs to loop to end as there will be different number of rows each time my report is run

Thanks in advance
IfSame.xlsx
0
Comment
Question by:Jagwarman
2 Comments
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 500 total points
ID: 40325200
Sub Remove()
For introw = 9999 To 1 Step -1
    If Cells(introw, 3) = "ABCD" Then
        For introw2 = 9999 To 1 Step -1
            If Cells(introw2, 3) = "WXYZ" And Cells(introw2, 11) = Cells(introw, 11) Then
                Rows(introw).Delete
                Exit For
            End If
        Next
    End If
Next
End Sub
0
 

Author Comment

by:Jagwarman
ID: 40325217
Can't believe you did that so quickly thanks.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question