Attribute VB_Name = "Module1"
Sub DOUBLONS()
Attribute DOUBLONS.VB_ProcData.VB_Invoke_Func = " \n14"
    
    
 
    Application.ScreenUpdating = False
    test = Timer
 
    der_ligne = Range("K" & "65000").End(xlUp).Row
 
    Dim tab_cells()
    ReDim tab_cells(der_ligne - 1)
 
    For ligne = 1 To der_ligne
        tab_cells(ligne - 1) = Range("K" & ligne)
    Next
 
    nb = 0
    compteur = 0
 
    For ligne = 1 To der_ligne
        contenu = tab_cells(ligne - 1)
 
       
 
        If ligne > 1 And contenu <> "" Then 'Effacer/supprimer doublons
            For i = 1 To ligne - 1
                If contenu = tab_cells(i - 1) Then 'Si doublon
                    nb = nb + 1
                    
                        Range(ligne + compteur & ":" & ligne + compteur).Delete
                        compteur = compteur - 1
                    
                    Exit For
                End If
            Next
        End If
 
       
    Next
 
    res_test = Format(Timer - test, "0" & Application.DecimalSeparator & "000")
    Application.ScreenUpdating = True
 
    
   If nb = 0 Then
        dd = MsgBox("Aucun doublon trouvé dans la colonnne K", 64, "Résultat")
    
    End If
            der_ligne = Range("K" & "65000").End(xlUp).Row
            dd = MsgBox(der_ligne - 1 & " personnes sur le site ", 64, "Batiment")
        'dd = MsgBox(nb & " doublons supprimés ", 64, "Résultat")
    
    'der_ligne = Range(choix2 & "65000").End(xlUp).Row
    'dd = MsgBox(der_ligne - 1 & " personnes sur le site ", 64, "Batiment")
End Sub
