ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Conditional Format to Delete Row (https://www.excelbanter.com/excel-programming/343702-conditional-format-delete-row.html)

Teresa C

Conditional Format to Delete Row
 
I have a conditional format that turns the cell red if today date is 45 days
greater thatn the date in the cell. If the cell is red, how can I delete the
entire row automatically?


--
TC

Tom Ogilvy

Conditional Format to Delete Row
 
Assume the date is held in column F

Dim lastRow as Long, i as Long
lastrow = cells(rows.count,"F").End(xlup).row
for i = lastrow to 2 step -1
if clng(Date) clng(cells(lastrow,"F").Value2) + 45 then
rows(i).Delete
end if
Next

so check the condition. It is extremely difficult to check the color of a
cell colored by conditional formatting.

--
Regards,
Tom Ogilvy

"Teresa C" wrote in message
...
I have a conditional format that turns the cell red if today date is 45

days
greater thatn the date in the cell. If the cell is red, how can I delete

the
entire row automatically?


--
TC





All times are GMT +1. The time now is 03:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com