Hello,
I haven't been able to find a solution to this problem I'm having. I have two lists of emails (one with first name, last name, and email; the other with just email).
When merged together, one shows a list of all of my customers, the other shows an email list of customers that currently own my product. I want remove the emails of the customers that own the product, and remove them from the original list (please see attached).
My problem is that I can easily remove the duplicate emails, but can't figure out how to also delete the row with their first name, last name, and email (without spending a great deal of time doing this manually).
Any help would be greatly appreciated. Thank you!
Adam
Last edited by Adam845; 01-24-2012 at 01:24 PM.
hi Adam845
welcome to excel forum, so how do we know which ones have your product and need to be deleted ?
regards pike
If the solution helped please donate here to the RSPCA
Sites worth visiting;
J&R Solutions - royUK
AJP Excel Information - Andy Pope
Spreadsheet Toolbox
VBA for smarties - snb
Hi pike,
The customers that own the product are in the rows with just the email address. So, I need to figure out how remove both that row and the row above with their first name, last name, and email address, ultimately resulting in a list of customers that don't own our product yet. I've been deleting both rows manually for months (extremely time consuming), but I'm sure there is an easier way to do it. Thanks for the response; I hope that clarifies my issue.
aaarh that will be
Sub ptest() Dim xRow As Long Application.ScreenUpdating = False For xRow = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1 If IsEmpty(Cells(xRow, "A")) And Cells(xRow, "C") = Cells(xRow - 1, "C") Then Cells(xRow, "A").EntireRow.Delete xlShiftUp Cells(xRow, "A").EntireRow.Delete xlShiftUp End If Next Application.ScreenUpdating = True End Sub
regards pike
If the solution helped please donate here to the RSPCA
Sites worth visiting;
J&R Solutions - royUK
AJP Excel Information - Andy Pope
Spreadsheet Toolbox
VBA for smarties - snb
Thanks for this, pike.
Unfortunately the code doesn't seem to be working on my end, though I could be entering it incorrectly. These are the steps I took:
Copy the Excel VBA code that you want to use
Select the workbook in which you want to store the Excel VBA code
Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
Choose Insert | Module
Where the cursor is flashing, choose Edit | Paste
To run the Excel VBA code:
Choose Tools | Macro | Macros
Select a macro in the list, and click the Run button
After running the macro it deleted some of the rows with email addresses, but I was still left with some customers that had the product, but only the row with their email address (e.g. from my example "Randall Turner") and it deleted others that I still needed to contact (e.g. from my example "John Carpenter").
so only the active sheet blank cell row?
Sub ptest() Dim xRow As Long Application.ScreenUpdating = False For xRow = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1 If IsEmpty(Cells(xRow, "A")) And Cells(xRow, "C") = Cells(xRow - 1, "C") Then Cells(xRow, "A").EntireRow.Delete xlShiftUp End If Next Application.ScreenUpdating = True End Sub
regards pike
If the solution helped please donate here to the RSPCA
Sites worth visiting;
J&R Solutions - royUK
AJP Excel Information - Andy Pope
Spreadsheet Toolbox
VBA for smarties - snb
LOL.. left out a -1
Just couldnt see it was missingSub ptest() Dim xRow As Long Application.ScreenUpdating = False For xRow = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1 If IsEmpty(Cells(xRow, "A")) And Cells(xRow, "C") = Cells(xRow - 1, "C") Then Cells(xRow, "A").EntireRow.Delete xlShiftUp Cells(xRow - 1, "A").EntireRow.Delete xlShiftUp End If Next Application.ScreenUpdating = True End Sub
regards pike
If the solution helped please donate here to the RSPCA
Sites worth visiting;
J&R Solutions - royUK
AJP Excel Information - Andy Pope
Spreadsheet Toolbox
VBA for smarties - snb
If you are satisfied with the solution(s) provided, please mark your thread as Solved.
How to mark a thread Solved
Go to the first post
Click edit
Click Go Advanced
Just below the word Title you will see a dropdown with the word No prefix.
Change to Solved
Click Save
regards pike
If the solution helped please donate here to the RSPCA
Sites worth visiting;
J&R Solutions - royUK
AJP Excel Information - Andy Pope
Spreadsheet Toolbox
VBA for smarties - snb
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks