PDA

View Full Version : Delete by Dates



Ifortesi Daj
01-08-2018, 04:15 AM
Sorry Buddy, I am new to this website and cannot figure out how to post a question...
I hope someone can help me modify my code a little bit and help me understand how it works.
So I have a list of dates and would like to delete the cells in Column K "From" and L "Until", if the date in Column L "Until", is Smaller than the current date of today.
So basically if Until date is smaller than today then the From date is smaller too, so delete them both. The dates are in Columns K:Z.
I made this code but cannot figure out a way to tell it to delete the cell to the left too.

Sub Clearcontents()
Dim Rng As Range
For Each Rng In ActiveSheet.UsedRange
If Rng.Value2 < Date Then Rng.Clearcontents
Next Rng
End Sub

Any help is appreciated

Thank You

Nick.
21318

SamT
01-08-2018, 04:36 PM
This post has been moved from a non related thread in the Outlook Folder.