Private Sub CommandButton1_Click() 'bouton Remplacer
If TextBox1 = "" Then TextBox1.SetFocus: Exit Sub
If TextBox2 = "" Then TextBox2.SetFocus: Exit Sub
Dim w As Worksheet, flag As Boolean
For Each w In Worksheets 'recherche dans toutes les feuilles
If Not w.Cells.Find(TextBox1, LookIn:=xlFormulas, LookAt:=xlWhole) Is Nothing Then
flag = True
w.Unprotect "lino" 'même mot de passe pour toutes les feuilles
w.Cells.Replace TextBox1, TextBox2, LookAt:=xlPart
w.Protect "lino"
End If
Next
If Not flag Then
With TextBox1
MsgBox "Le prénom """ & .Text & """ n'existe sur aucune feuille...", 48
.SetFocus
.SelStart = 0
.SelLength = Len(.Text) 'sélection du texte entier
End With
Exit Sub
End If
Unload UserForm1
End Sub