Saisir le meme login deux fois

salut , dans mon projet VBA j'ai deux UserForme Differentes et l'une parés l'autre , je veux saisir le 2 eme login (UserFormModif) identique a celle du depart (UserFormLOGIN)

ici dans mon code il teste pour tous les login est ce que existe ou pas , or que je besoin de tester sur le login saisi au debut uniquement ,

voila mon code

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

et voici mon application pour mieux comprendre

Ps: j'ai tester aussi :

if UserFormLOGIN.TextBox1.value = UserFormMODIF.TextBox14.value THEN

Msgbox"ok"

else

Msgbox " login incorrect"

End if

Rechercher des sujets similaires à "saisir meme login deux fois"