Formulaire avec sélection de champs

Résolu/Fermé
senecartour Messages postés 325 Date d'inscription dimanche 12 mai 2013 Statut Membre Dernière intervention 29 octobre 2020 - 30 mars 2014 à 23:36
senecartour Messages postés 325 Date d'inscription dimanche 12 mai 2013 Statut Membre Dernière intervention 29 octobre 2020 - 31 mars 2014 à 16:35
Bonjour,

J'ai écris un code pour afficher les données des champs dans mon UserForm, sauf qu'en exécutant ma macro, j'ai l'erreur "sur LisIndex"


Ci-joint le fichier: https://www.cjoint.com/?DCExHVOeHUq


Private Sub UserForm_Initialize()
ComboBox1.RowSource = ("Ref")
End Sub

Private Sub ComboBox1_Change()
TextBox1 = ComboBox1.List(ComboBox1.ListIndex, 1)
TextBox2 = ComboBox1.List(ComboBox1.ListIndex, 2)
TextBox3 = ComboBox1.List(ComboBox1.ListIndex, 3)
End Sub

Private Sub CommandButton1_Click()
Point = ComboBox1.ListIndex + 1
TextBox1 = Range("Matrice").Cells(Point, 1)
TextBox2 = Range("Matrice").Cells(Point, 2)
TextBox3 = Range("Matrice").Cells(Point, 3)
End Sub


1- J'ai bien fait la liste déroulante
2- I'ai affecté la valeur des textBox avec la listIndex

Mais la Macro ne focntionne pas!

Existerait-il un détails qui m'échappe?

Merci d'avance et désolé encore!

2 réponses

f894009 Messages postés 17185 Date d'inscription dimanche 25 novembre 2007 Statut Membre Dernière intervention 15 avril 2024 1 701
31 mars 2014 à 07:52
Bonjour,

Votre combobox n'ayant qu'une colonne, difficile d'avoir les infos des 3 colonnes qui n'existent pas
0
senecartour Messages postés 325 Date d'inscription dimanche 12 mai 2013 Statut Membre Dernière intervention 29 octobre 2020 3
31 mars 2014 à 16:35
OK! problème résolue!
Effectivement il y avait un problème sur la définition de la plage de ma liste
0