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 turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
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,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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