Maybe something like this will work.
Option Explicit
Sub DeleteRow()
Dim row As Range
Dim c As Range
For Each row In Selection.EntireRow
Set c = row.Find(What:="Do Not Delete")
If c Is Nothing Then
row.Delete
End If
Next row
End Sub
Mark
jagexcel wrote:
The cell has the content "Do Not Delete"
How do I write an If statement to prevent this cell from being deleted
by a macro that deletes a row?
Thanks.
--
jagexcel
------------------------------------------------------------------------
jagexcel's Profile: http://www.excelforum.com/member.php...o&userid=35657
View this thread: http://www.excelforum.com/showthread...hreadid=556248