ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Clear row contents code (https://www.excelbanter.com/excel-programming/272717-clear-row-contents-code.html)

Rohit Thomas

Clear row contents code
 
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


All times are GMT +1. The time now is 01:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com