Finding and deleting all rows with specific values.

panda4444

New Member
Joined
May 14, 2003
Messages
23
you guys are great! ok heres a new one.. maybe a simple one.

How can I find a text value and delete all that rows with the value in it?

For example.

There are three columns A,B,C
And I want to find all column C cells with then name NANCY and delete the WHOLE row including columns ABC associated with the Nancy value.???

I plan to put this in a macro.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
alright this one works great! So I went ahead and recorded it in a macro..

However, occasionally one problem occurs.

IF the macro does not find the value during the process the below link provides it gets hung up and wants to get debugged.

Is there a way to initate a search and if not found make the macro skip and try and find the next value to delete?
 
Upvote 0
BTW: here is the part of the macro I'm talking about....

Selection.AutoFilter
Selection.AutoFilter Field:=2, Criteria1:="=*bill**", Operator:=xlAnd
Application.Goto Reference:="R2:R65536"
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Delete Shift:=xlUp

the value here is "bill" when it does not find it, the macro stops.
 
Upvote 0

Forum statistics

Threads
1,221,709
Messages
6,161,432
Members
451,705
Latest member
Priti_190

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