Private Sub CmdRecherche_Click()
Dim ctrl As Control, i%, j%
Set ws = Sheets("enregistrement clients")
With ws
'Numéro de ligne.
i = WorksheetFunction.Match(Me.ComboBox1.Text, .Columns(4), 0)
'On boucle les contrôles.
For Each ctrl In Controls
If ctrl.Tag <> "" Then
j = Val(ctrl.Tag)
ctrl.Value = .Cells(i, j).Value
End If
Next ctrl
End With
'Adaptation des formats.
With Me
.TextBox7.Value = Format(.TextBox7.Value, "00 00 00 00 00")
.TextBox8.Value = Format(.TextBox8.Value, "00 00 00 00 00")
.TextBox12.Value = Format(.TextBox12.Value, "0")
.TextBox13.Value = Format(.TextBox13.Value, "0")
.TextBox14.Value = Format(.TextBox14.Value, "### €")
.TextBox15.Value = Format(.TextBox15.Value, "### €")
End With
End Sub