Dans une liste excel je désire trouver un mot.
Si celui-ci n'existe pas la macro plante sur la fonction find.
Je désire que dans ce cas on retourne au depart.
Ma macro, ci-dessous.
Merci d'avance pour une réponse.
Sub recherche()
Sheets("Fichier").Select
Columns("B:B").Select
depart:
decujus = InputBox("Mettre le nom: ", "Nom")
Selection.Find(What:=decujus, After:=Cells(2, 2), LookIn:=xlFormulas, LookAt:=xlPart, _
SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:=False).Activate
For Index = 1 To 100
OK = InputBox("OK ? oui/non", "Nom")
Cells(1, 30).Value = OK
okok = Cells(1, 31).Value
If okok = "OUI" Then
surnom = decujus
Exit For
Else
Selection.FindNext(After:=ActiveCell).Activate
ActiveCell.Font.Color = RGB(0, 255, 0)
End If
Next
End Sub