Delete rows if contain specific value in column with vba I have a column L with
ID: 643229 • Letter: D
Question
Delete rows if contain specific value in column with vba
I have a column L with different dates I need delete row that contain dates greater and equals than today with vba. I have the below code but not work correctly. Help with this code
Sub DeleteDates()
Dim r As Long
Dim m As Long
Set ws = Worksheets("Sheet1")
m = ws.Range("L" & ws.Rows.Count).End(xlUp).Row
For r = m To 2 Step -1
If ws.Range("L" & r).Value >= Date - 1 Then
ws.Rows(r).delete
End If
Next r
End Sub
Thanks for help !!
Explanation / Answer
Hi..
I don't see any problem with your code except you should remove -1 in the below code
If ws.Range("L" & r).Value >= Date - 1 Then
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.