Formula or VBA help!!!

Luchano

Board Regular
Joined
Jul 25, 2013
Messages
84
Hello all!

I need heeeeeelp! I thought I was good in Excel until I encounter this problem :oops: I'm trying to create a formula or if possible a VBA script that fulfills 3 conditions.

Let's say we have the table below, and what we need is to:
  1. if a Name in column 1 appears more than once AND in the 2nd column appears "Residential Lending," then Remove All Rows Above and/or Below where the Same Name appears more than once
  2. if in column 2 appears banking but in column 1 the same name appears more than once Above or Below, then leave as is
  3. Else leave As Is

Any help is appreciated. Thank you in advance!!!!
Frank, LLC</SPAN>

<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>
Residential Lending</SPAN>

<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>
$ - </SPAN>

<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>
Frank, LLC</SPAN>

<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>
Banking</SPAN>

<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>
$ 52,793.34 </SPAN>

<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>
Frank, LLC</SPAN>

<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>
Lending</SPAN>

<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>
$ 6,395,507.27 </SPAN>

<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>

<TBODY>
</TBODY>
</SPAN>
</SPAN>

<TBODY>
</TBODY><COLGROUP><COL><COL><COL></COLGROUP>
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
so if frank res lending is on rows 23 to 25 delete rows 1 to 22 and 26 to 99999

Thanks for the reply!

Not quite.

So, if frank res lending in row 23, but frank also appears in row 25 (even if no res lending), then delete rows where frank's name appears

Thanks again!
 
Upvote 0
You are both too brief in your posts. You ought to post example input and output to clarify.
 
Upvote 0

Forum statistics

Threads
1,213,568
Messages
6,114,348
Members
448,570
Latest member
rik81h

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