Purge Data Based on Cell Color and Time

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying find a way to purge data after a few hours based on if certain
cells have a fill color of green. Excel may not be the best application to
use to accomplish this task.
 
Do you mean you want to clear the cells, say 10 hours from now, if they are
say red?

If so, you are best to write a macro testing teh colour and clearing the
cells, and the use Ontime to launch that after your specified time interval.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Yes, once the cells turn green (signifies as ready) then, say 10 hours from
now the cells can be cleared (or deleted since we want data below to move to
the top of the list).

I'm not real familiar with writing macros. Do you know where I can find
some sample code to make this happen?

Thank you, Todd
 
Here is a sample sub

Sub ClearColours()
Dim cell as Range

For Each cell In Thisworkbook.Worksheets("Sheet1").UsedRange
If cel.Interior.Colorindex = 10 Then
cell.delete xlShiftUp
End If
Next cell

End Sub

It would get fired like so

Ontime Now + TimeSerial(10,0,0),"ClearColour"

I have no idea what turns the cell green so I cannot advice as to how the
OnTime command would be executed.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Bob, you got me started and really helped to get me in the right direction.
I believe I have it working the way I envisioned (with the exception of the
time part - I have not started on that yet).

Thanks again, Todd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top