This sheet import a file.
In column G are the unique value
my problem, during the import file, skip the rekord if this is already imported
(for example if i impot the same file twice)
Printable View
This sheet import a file.
In column G are the unique value
my problem, during the import file, skip the rekord if this is already imported
(for example if i impot the same file twice)
Hi Sal,
Here's a routine that should delete the entire row(s) of any exact duplicates within the used range. It won't prevent the data from being imported twice, but should clean it up after the fact if it happens.
Just change the reference from B11 to the Top / Left cell of you range of interest.Code:Sub DeleteDuplicateRows()
Dim iRow As Long
Dim jRow As Long
Dim iCol As Integer
Dim LastRow As Long
Dim FirstRow As Long
Dim FirstCol As Integer
Dim LastCol As Integer
Dim DelCount As Long
Dim DupFound As Boolean
DelCount = 0
Range("B11").CurrentRegion.Select '(Selects the range)
FirstRow = Selection.Row
LastRow = FirstRow + Selection.Rows.Count - 1
FirstCol = Selection.Column
LastCol = FirstCol + Selection.Columns.Count - 1
For iRow = FirstRow To LastRow - 1
For jRow = iRow + 1 To LastRow
DupFound = True
For iCol = FirstCol To LastCol
DupFound = DupFound And (Cells(jRow, iCol) = Cells(iRow, iCol))
If Not DupFound Then Exit For
Next iCol
If DupFound Then
Rows(jRow).Delete
LastRow = LastRow - 1
DelCount = DelCount + 1
End If
Next jRow
Next iRow
[A1].Select
End Sub
Hope it helps,
Dan
Forget it, Sal. I want the pasta!!Quote:
Sal
1 help 1 pizza
2 help 1 pizza 1 caff?
3 help 1 pizza 1 caff? 1 mozzarella
How do I get the spaghetti!!??
Ok! ... for the spaghetti, i adjust my signature...
LOL!! Yes. Spaghetti will be safer now, I think. I tell you, I ate pizza, and it is true--not a joke! Hee hee.
Tks HalfAce, but for me is important during the import of file....