Sub ajouterLesNonRepertories()
Dim objSource As Worksheet
Dim objDestination As Worksheet
Dim objCellSource As Range
Dim objCellDestination As Range
Dim strRecherche As String
Dim blnTrouver As Boolean
Set objSource = Worksheets("importation")
Set objDestination = Worksheets("Feuil4")
For Each objCellSource In objSource.Range("B2:B6")
blnTrouver = False
Set objCellDestination = objDestination.Range("A2")
While Not blnTrouver And objCellDestination.Row < 6
If CStr(objCellDestination.Value) = objCellSource.Value Then
blnTrouver = True
Else
'On passe a la cellule suivante
Set objCellDestination = objDestination.Cells(objCellDestination.Row + 1, 1)
End If
Wend
If blnTrouver Then
MsgBox "trouve : " & objCellSource.Value
'ICI LE CODE POUR LE CAS OU LA RECHERCHE EST FRUCTUEUSE
Else
MsgBox "pas trouve :" & objCellSource.Value
'ICI LE CODE POUR LE CAS OU LA LIGNE N'EST PAS TROUVEE
objSource.Cells(objCellDestination.Row, 3).Copy
objDestination.Range("G10").Insert (xlShiftDown)
End If
Next
End Sub