PDA

View Full Version : How to delete rows if a cell is red?



killbill
02-06-2014, 07:48 AM
I am looking for a macro that will delete an entire row if the following condition is met:
If a cell in column B is red then delete that row.
I used conditional formatting in order to change the background colour. I mention that because I used several macro codes but they did not work.

Thanks in advance!

GTO
02-07-2014, 04:33 AM
Hello again,

I just spotted (a little slow this lad) that you have your first three questions apparently aimed at the same goal. Or at least maybe? Are we trying to delete rows that are red (based on CV), or, are blank ( http://www.vbaexpress.com/forum/showthread.php?48863-macro-to-delete-row-if-cell-is-empty ), or, are not within certain timeframes (http://www.vbaexpress.com/forum/showthread.php?48860-macro-to-delete-data-based-on-time )?

If I am wrong and these questions are about different sheets, my apologies.

If I am right, I still am thankful that you joined with the idea of following the rules and keeping a question focused. That said, I think something that works against the same range object is really part of one question, as it really boils down to solving something (one "thing") with a couple of OR conditions. Does that make sense?

Mark

GTO
02-07-2014, 04:39 AM
ACK! I forgot to mention: If looking to do something with a cell based on color due to CV, you want to do the same test(ing) as what met the conditions for the formatting.