I have the below which doesn't work for some reason. I want it to find the date in P1 in column B and when it finds the date that will be in P1 to delete that row it finds it on and all rows below it.
Sub test()
'adds 7 days to date in B2 in Fixtures and deletes all rows below this date
Range("P1").Select
ActiveCell.FormulaR1C1 = "=R[1]C[-14]+7"
Range("P1").Select
Selection.NumberFormat = "dd/mm/yyyy"
'find the new date above in column B and delete all rows below it
Dim LR As Long, Found As Range
LR = Range("B" & Rows.Count).End(xlUp).Row
Set Found = Columns("B").Find(What:=P1, LookIn:=xlValues, LookAt:=xlWhole)
If Not Found Is Nothing Then Rows(Found.Row & ":" & LR).Delete
End Sub
Bookmarks