Clear contents of cell if before a certain date

RJMiller

New Member
Joined
Jul 20, 2009
Messages
2
I want to clear the contents of cells on an entire sheet if the contents are a date before, let's say, 9/1/2008.
Is there a macro for this?

Thanks,
RJ
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
So.. if say cell a1 contained 09/01/2008 you want to clear the entire sheet ?

eg Sheet 1
Code:
Private Sub clearit()
    If Range("A1") >= "09/01/2008" Then Exit Sub
    Cells.Select
    Selection.ClearContents
End Sub
 
Upvote 0
Oops sorry. No I only want to clear the cells that have dates before 9/1/2009. The content of the cell IS the date. I want to clear the date from the cell.
 
Upvote 0

Forum statistics

Threads
1,215,613
Messages
6,125,834
Members
449,266
Latest member
davinroach

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