deleting duplicates

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have rows a, b, and c that need to be analyzed for duplicate data. Also
there are blanks in row B. I've tried extending the range but then when I
test it, it still shows zero. Can someone please help me. thank you
 
Try this:
Sub DeleteRows()
Set r = ActiveSheet.UsedRange
nLastRow = r.Rows.Count + r.Row - 1
For i = nLastRow To 1 Step -1
For j = 1 To Columns.Count
v = Cells(i, j).Value
If InStr(1, v, "delete") > 0 Then
Cells(i, j).EntireRow.Delete
Exit For
End If
Next
Next
End Sub
 

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

Back
Top