?
Solved

find matching data and remove

Posted on 2014-09-16
2
Medium Priority
?
94 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
[X]
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
2 Comments
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 2000 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

743 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