Find today's date and delete row

TWINKLEMARVEL

Board Regular
Joined
Sep 24, 2008
Messages
101
I have datas in excel where there are lot of dates in column "C" with the format "dd.mm.yyyy". I need a macro to find out today's dates and delete the entire ROW.

Pls help.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Code:
Sub Delete_Todays_Row()
    
    Dim Found As Range, Again As Boolean
    Application.ScreenUpdating = False
    Do
        Set Found = Range("C:C").Find(Date)
        Again = Not Found Is Nothing
        If Again Then Found.EntireRow.Delete
    Loop Until Not Again
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
Thanks for the quick response. The code works when I change the date format. I downloaded the data from server and the format appears like "dd.mm.yyyy"
Example: 31.05.2011

Pls help me to modify the code accordingly.

Thanks in advance
 
Upvote 0
Code:
Sub DeleteTodays()
    
    Dim i As Long
    
    Application.ScreenUpdating = False
    
    For i = 1 To Cells(Rows.Count, "C").End(xlUp).Row
        If Date = CDate(Cells(i, 1)) Then Cells(i, 1).EntireRow.Delete
    Next
    
    Application.ScreenUpdating = True
    
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,558
Messages
6,179,512
Members
452,921
Latest member
BBQKING

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