Wenderson Prates
17-07-2014 14:06:06
Eu tenho Pla1 e Plan2 ele vai pegar o que tenho na plan1 coluna A e excluir todos os repitidos na Plan2 Coluna A alguém, poderia me ajudar. Exemplo das palnilhas:
Plan1 Plan2
Col.A Col.A
T1-1 T1-1 (Excluir)
T2-2 T1-1 (Excluir)
............ T2-2 (Excluir)
............ T2-2 (Excluir)
............ T3-3
............ T3-3
Se puder me ajudar agradeço a atenção! Estou tentando usar o código abaixo mas não esta dando certo! Obrigado....
Sub DelDups()
Dim iListCount As Integer
Dim iCtr As Integer
Application.ScreenUpdating = False
UltLin = Cells(Rows.Count,"A").End(xlUp).Row
iListCount = Sheets("Sheet2").Range("A2:A" & UltLinha).Rows.Count
For Each x In Sheets("Sheet1").Range("A2:A" & UltLinha)
For iCtr = 1 To iListCount
If x.Value = Sheets("Sheet2").Cells(iCtr, 1).Value Then
Sheets("Sheet2").Cells(iCtr, 1).EntireRow.Delete
iCtr = iCtr + 1
End If
Next iCtr
Next
Application.ScreenUpdating = True
End Sub
Plan1 Plan2
Col.A Col.A
T1-1 T1-1 (Excluir)
T2-2 T1-1 (Excluir)
............ T2-2 (Excluir)
............ T2-2 (Excluir)
............ T3-3
............ T3-3
Se puder me ajudar agradeço a atenção! Estou tentando usar o código abaixo mas não esta dando certo! Obrigado....
Sub DelDups()
Dim iListCount As Integer
Dim iCtr As Integer
Application.ScreenUpdating = False
UltLin = Cells(Rows.Count,"A").End(xlUp).Row
iListCount = Sheets("Sheet2").Range("A2:A" & UltLinha).Rows.Count
For Each x In Sheets("Sheet1").Range("A2:A" & UltLinha)
For iCtr = 1 To iListCount
If x.Value = Sheets("Sheet2").Cells(iCtr, 1).Value Then
Sheets("Sheet2").Cells(iCtr, 1).EntireRow.Delete
iCtr = iCtr + 1
End If
Next iCtr
Next
Application.ScreenUpdating = True
End Sub