Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi: I'm trying to adapt a vb code I found on the we (http://www.ozgrid.com/VBA/VBACode.htm) to work for me. I need to g thru column A evaluating each cell against the rest to the cells i that colum. If I find a duplicate, then delete the entire row. Th objective is to leave only one of each in the colum. This is what I have so far: Sub DelDupsONEList() Dim iListCount As Integer Dim iCtr As Integer ' Application.ScreenUpdating = False ' iListCount = ActiveSheet.Range("A1:A1000").Rows.Count For Each x In ActiveSheet.Range("A1:A1000") For iCtr = 1 To iListCount If x.Value = ActiveSheet.Cells(iCtr, 1).Value Then ActiveSheet.Cells(iCtr, 1).EntireRow.Delete iCtr = iCtr + 1 End If Next iCtr Next Application.ScreenUpdating = True MsgBox "Done!" End Sub I'm getting an error on: If x.Value = ActiveSheet.Cells(iCtr, 1).Value Then... ANy help would be greatly appreciated -- halem ----------------------------------------------------------------------- halem2's Profile: http://www.excelforum.com/member.php...nfo&userid=993 View this thread: http://www.excelforum.com/showthread.php?threadid=27059 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Deleting Duplicates | Excel Discussion (Misc queries) | |||
Deleting duplicates | Excel Discussion (Misc queries) | |||
Deleting Duplicates | Excel Worksheet Functions | |||
Deleting the first row of two duplicates. | Excel Discussion (Misc queries) | |||
Deleting Duplicates | Excel Programming |