If Search Delete Next Row?

MMortal

New Member
Joined
Apr 3, 2013
Messages
4
I do mailing lists and I have to clean up the list so only one household get a mailing. I use this formula to merge first names if the last name and address are the same.

=IF(AND(D3=D2,C3=C2),B2&" AND "&B3&"", B2)

As you can see this will merge the first name, add "and" then merge the second person's first name. That leaves the second person's first name in the next row. I than have to go delete the extra row of the person not merged. I would like to create a macro that does something like this:

=IF(ISNUMBER(SEARCH("*AND*",B2)),"delete", "Keep")

but delete the next row down.

I have searched this forum and all over Google and found ways to search and delete the row of the cell, but nothing on deleting the next entire row down. I used just pull the data I needed using SQL from the Database but my business changed database companies and they don't want anybody in there.

Thank you in advance.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
I figured out a way to do this! I am not using a Macro. I used this formula on the end: =IF(ISNUMBER(SEARCH("* AND *", A1)),"Delete", "Keep") than copied that row pasted special values. Sort, Delete, done. Hope this helps somebody out there with a similar issue.
 
Upvote 0
Important part here is to have everything custom sorted by address than last name run first formula. Than run the solution formula on the end.
 
Upvote 0
I was going to add that you could use the VBA construct of .Offset(column, row +1) .delete if you end up doing it in VBA.
 
Upvote 0

Forum statistics

Threads
1,214,848
Messages
6,121,914
Members
449,054
Latest member
luca142

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top