Solved

find matching data and remove

Posted on 2014-09-16
2
92 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 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

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.
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

695 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