bonjour
je suis en excel 2007
j'ai un formulaire avec une clé sur nom et prénom concaténé (combobox1)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| ' **************************************
'Correspond au programme de la LISTE DEROULANTE
' **************************************
Private Sub ComboBox1_Change()
Dim ligne As Long
Dim i As Integer
Dim chemin As String
If Me.ComboBox1.ListIndex = -1 Then GoTo etiq_csp:
ligne = Me.ComboBox1.ListIndex + 2
Me.ComboBox1 = ws.Cells(ligne, "A")
Me.TextBox1 = ws.Cells(ligne, "B")
Me.TextBox8 = ws.Cells(ligne, "C") |
et dans ce traitement j'ai un autre combobox2 sur un champ catégorie socio professionnelle (8 valeurs)
1 2 3 4 5 6 7 8 9 10 11 12 13
| ' **************************************
' LISTE DEROULANTE :CSP
' **************************************
etiq_csp:
If Me.ComboBox2.ListIndex = -1 Then GoTo etiq_tri:
ligne = Me.ComboBox2.ListIndex + 2
With ComboBox2
Me.TextBox13 = ws.Cells(ligne, "M") ' CSP
End With
etiq_tri: Call TRIBEN |
Mon problème vient de la non efficacité du test i
If Me.ComboBox2.ListIndex = -1 [/B]Then GoTo etiq_tri:
comme conséquence je n'affiche pas ma catégorie
par ailleurs j'ai déclaré
1 2 3 4 5 6 7 8 9 10
| Private Sub ComboBox2_Click()
If csp_invoked_init = "oui" Then Exit Sub
MsgBox ComboBox2.Value
TextBox13 = ComboBox2.Value
End Sub
Private Sub ComboBox2_Change()
MsgBox ComboBox2.Value
TextBox13 = ComboBox2.Value
End Sub |
merci pour votre aide
michel
Partager