Private Sub CommandButton1_Click()
UserForm1.Hide
Dim i As Range
Dim noLign, var As Integer
Dim tot, prem As Integer
Dim strPrem As String
var = 0
Cells.Select
Selection.Interior.ColorIndex = xlNone
Range('A9').Select
For Each i In Range('A9:A' & Range('A65536').End(xlUp).Row)
tot = Len(i.Value)
prem = tot
Do While prem > 0
strPrem = Mid(i.Value, prem, 1)
If strPrem = ' ' Then
GoTo ctr
Else
prem = prem - 1
End If
Loop
ctr:
If Mid(i.Value, prem + 1, Len(i.Value)) = Me.TextBox1.Value Then
i.EntireRow.Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
var = var + 1
End If
Next i
Range('A8').Select
MsgBox var & ' ligne(s) ont été surlignée(s)', vbOKOnly
End Sub