I have a database where entries are placed in the next available row. I tried to write a code that would delete the rows where the value in column A of that row is "EXAMPLE". I get the error that rw after Then is an "invalid qualifer". Here is my code:

Sub deleteExample()
Dim rw As Long
With Sheets("Data")
rw = .Range("A" & .Rows.Count).End(xlUp).Row + 1 ''next available row
If .Range("A" & rw).Value = "EXAMPLE" Then rw.EntireRow.Delete Shift:=xlUp
End With

End Sub

I suspect this is a simple fix, but I appreciate any help. Thank you!

Luke