Conditional Row Delete


Posted by Todd on January 22, 2002 2:09 PM

Is there a way to delete an entire row if it meets a certain condition?

Posted by Barrie Davidson on January 22, 2002 2:38 PM

You can do it using VBA. How do you determine your condition?

BarrieBarrie Davidson

Posted by Mark W. on January 22, 2002 2:42 PM

You can apply an AutoFilter and delete the displayed
rows which meet your criteria.

Posted by Todd on January 22, 2002 2:50 PM

I guess thats what I'm unsure of.
An example would be "if a cell would equal, let's say 9 then delete the entire row".

Thanks,
Todd



Posted by Barrie Davidson on January 23, 2002 6:14 AM

Todd, this is the VBA code to delete a row based on your example.

If ActiveCell.Value = 9 Then ActiveCell.EntireRow.Delete

Does this help you out?
BarrieBarrie Davidson