Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
deleting duplicates
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
deleting duplicates
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 -- If this posting was helpful, please click on the Yes button. Regards, Michael Arch. "Nolaughmtr" wrote: 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
deleting duplicates
no that didnt work. i dont htink it did anything.
"Michael" wrote: 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 -- If this posting was helpful, please click on the Yes button. Regards, Michael Arch. "Nolaughmtr" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Deleting Duplicates | Excel Worksheet Functions | |||
Deleting Duplicates | Excel Discussion (Misc queries) | |||
Deleting duplicates | Excel Discussion (Misc queries) | |||
Deleting Duplicates | Excel Programming | |||
Deleting Duplicates | Excel Programming |