CicoMico
07-24-2007, 10:36 PM
hey! i thought that my problem with deleting duplicated rows is solved, but... i am getting mismatch error on this line:
If Application.CountIf(.Columns(TEST_COL), .Cells(i, TEST_COLUMN).Value) > 1 Then
if i do debug.print CountIf(.Columns(TEST_COL), it seems that this is the error part...
any help? thanx
xld's code:
Public Sub ProcessData()
Const TEST_COLUMN As String = "A" '<=== change to suit
Const TEST_COL As Long = 1 '<=== and this to match
Dim i As Long
Dim iLastRow As Long
With ActiveSheet
iLastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = iLastRow To 1 Step -1
If Application.CountIf(.Columns(TEST_COL), .Cells(i, TEST_COLUMN).Value) > 1 Then
.Rows(i).Delete
End If
Next i
End With
End Sub
Edited 25-Jul-07 by geekgirlau. Reason: insert vba tags
If Application.CountIf(.Columns(TEST_COL), .Cells(i, TEST_COLUMN).Value) > 1 Then
if i do debug.print CountIf(.Columns(TEST_COL), it seems that this is the error part...
any help? thanx
xld's code:
Public Sub ProcessData()
Const TEST_COLUMN As String = "A" '<=== change to suit
Const TEST_COL As Long = 1 '<=== and this to match
Dim i As Long
Dim iLastRow As Long
With ActiveSheet
iLastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = iLastRow To 1 Step -1
If Application.CountIf(.Columns(TEST_COL), .Cells(i, TEST_COLUMN).Value) > 1 Then
.Rows(i).Delete
End If
Next i
End With
End Sub
Edited 25-Jul-07 by geekgirlau. Reason: insert vba tags