Sub Delete_Rows_Based_On_Value()
Dim theDate As Date
Dim i As Long
LastRow = Cells(Rows.Count, 1).End(xlUp).Row 'get the lastRow
Application.ScreenUpdating = False
For i = LastRow To 1 Step -1
On Error Resume Next
theDate = Cells(i, 1)
If Month(theDate) = 6 Then
Cells(i, "A").EntireRow.Delete
End If
On Error GoTo 0
Next
Application.ScreenUpdating = True
End Sub
ASKER
Visual Basic for Applications (VBA) enables building user-defined functions (UDFs), automating processes and accessing Windows API and other low-level functionality through dynamic-link libraries (DLLs). VBA is closely related to Visual Basic and uses the Visual Basic Runtime Library, but it can normally only run code within a host application rather than as a standalone program. It can, however, be used to control one application from another via OLE Automation. VBA is built into most Microsoft Office applications.
TRUSTED BY
Your 1 and i were reversed.