Clear row contents code

R

Rohit Thomas

Hello All,

I am using the code below to clear the contents of an
entire row if a value from a named range (OperIdDel)
matches the value in column 7. The problem is that I need
it to clear the row only if it's an exact match.

Example: If 99 is one of the values in the named range,
the code will clear the entire row if column 7 has a value
of 599, or 34994, etc. Below is my code...what do I modify
to look for an exact match?


For Each OperDelRng In Sheets("Site Parameters"). _
Range("OperIdDel")
If OperDelRng.Value <> "" Then
With Columns(7)
Do
Set LookInRng = .Find(OperDelRng.Value, _
LookIn:=xlValues)
If Not LookInRng Is Nothing Then
LookInRng.EntireRow.ClearContents
End If
Loop While Not LookInRng Is Nothing
End With
End If
Next OperDelRng
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top