Remplir un formulaire après le saisi d'un login

bonjour , dans mon application VBA je veux remplir mon formulaire à partir d'un champ de login (feuille UserFormMODIF) , c à d le formulaire doit être remplir par les champs associés a ce login , sachant que j'ai un feuil 'SHEET1' pour chaque login les champs associés (username, userId .....)

PS: j'ai reussi de le remplir apartir d'un combobox mais c'est pas efficace vue que les autres logins ne doivent pas affichés pour tous , mais avec un simple textBox je ne sais pas comment!!

merci d'avance

Bonjour Nada, bonjour le forum,

Je suis pas sûr d'avoir bien compris... Essaie comme ça :

Private Sub CommandButton5_Click()
Dim O As Worksheet
Dim TV As Variant
Dim I As Integer
Dim TEST As Boolean
Dim no_ligne As Integer

Set O = Worksheets("SHEET1")
TV = O.Range("A1").CurrentRegion
For I = 2 To UBound(TV, 1)
    If TV(I, 1) = Me.TextBox14.Value Then
        no_ligne = I
        TEST = True
        Exit For
    End If
Next I
If TEST = True Then
    MsgBox "ok"
    TextBox1.Value = Cells(no_ligne, 2).Value
    TextBox2.Value = Cells(no_ligne, 3).Value
    ComboBox2.Value = Cells(no_ligne, 4).Value
    ComboBox3.Value = Cells(no_ligne, 5).Value
    TextBox5.Value = Cells(no_ligne, 6).Value
    ComboBox4.Value = Cells(no_ligne, 7).Value
    TextBox7.Value = Cells(no_ligne, 8).Value
    TextBox8.Value = Cells(no_ligne, 9).Value
    TextBox9.Value = Cells(no_ligne, 10).Value
    TextBox10.Value = Cells(no_ligne, 11).Value
    TextBox12.Value = Cells(no_ligne, 12).Value
    TextBox11.Value = Cells(no_ligne, 13).Value
    TextBox13.Value = Cells(no_ligne, 14).Value

    Me.TextBox1.Enabled = False
    Me.TextBox2.Enabled = False
    Me.ComboBox2.Enabled = False
    Me.ComboBox3.Enabled = False
    Me.TextBox5.Enabled = False
    Me.ComboBox4.Enabled = False
    Me.TextBox7.Enabled = False
    Me.TextBox8.Enabled = False
    Me.TextBox9.Enabled = False
    Me.TextBox10.Enabled = False
    Me.TextBox12.Enabled = False
    Me.TextBox11.Enabled = False
    Me.TextBox13.Enabled = False
Else
    MsgBox "login incorrect"
End If
End Sub

mercii beaucoup , c'est parfait

Rechercher des sujets similaires à "remplir formulaire saisi login"