Try this:
Code:Option Explicit Sub NewDelete() Dim W1Startdate As Date W1Startdate = InputBox("Please Enter the Start Data in DD/MM/YYYY format") Dim lr As Long lr = Range("G" & Rows.Count).End(xlUp).Row Dim i As Long Application.ScreenUpdating = False For i = lr To 3 Step -1 If Range("G" & i) >= W1Startdate Then Range("G" & i).EntireRow.Delete End If Next i Application.ScreenUpdating = True MsgBox "task complete" End Sub
Please use code tags when posting VBA Code in the forum. It makes for easier reading and is a forum standard.





Reply With Quote
Bookmarks