Solved

find matching data and remove

Posted on 2014-09-16
2
86 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
Comment Utility
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
Comment Utility
Can't believe you did that so quickly thanks.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now