Private Sub CommandButton2_Click()
Dim i As Byte, j As Byte, X As Byte
Dim Cible As String
Dim Val As Object
Dim FirstAddress As String, Resultat As String, Tableau() As String
1 Cible = InputBox("SAISIR LE NOM DU CAVALIER : ", "Recherche", "Le nom")
[COLOR="Red"]If Cible = "" Then Exit Sub[/COLOR]
Application.ScreenUpdating = False
For i = 2 To Sheets.Count
Sheets(i).Activate
With Sheets(i).UsedRange.Cells
Set Val = .Find(Cible, LookIn:=xlValues)
If Not Val Is Nothing Then
FirstAddress = Val.Address
Do
Val.Select
X = X + 1
ReDim Preserve Tableau(2, X)
Tableau(0, X - 1) = "Cellule " & Val.Address
Tableau(1, X - 1) = Sheets(i).Name
Set Val = .FindNext(After:=ActiveCell)
Loop While Not Val Is Nothing And Val.Address <> FirstAddress
End If
End With
Next i
Sheets(1).Activate
Application.ScreenUpdating = True
Resultat = "Resultat de la recherche sur le mom : " & Cible & Chr(10) & Chr(10)
If X = 0 Then
Resultat = Resultat & "Vide"
Else
For j = 1 To X
Resultat = Resultat & Tableau(0, j - 1) & Chr(9) & Tableau(1, j - 1) & Chr(10)
Next j
End If
MsgBox Resultat
[COLOR="Red"]GoTo 1[/COLOR] 'pour rouvrir l'InputBox
End Sub