Remplir TextBox avec une valeur correspondant a une listbox

Bonjour,

j'ai rempli une ListBoxMatiereIPE de la manière suivante:

    With UserFormPrix.ComboBoxMatiereIPE
      For J = 3 To 5
          .AddItem Ws.Range("A" & J)
      Next J
    End With

Ensuite je souhaite voir apparaître dans une TextBoxDensiteIPE la valeur de la densité rentrée dans une feuille Excel (colones C célulles 3,4,5)

Je souhaite lorsque je sélectionne une matière dans la ListBoxMatiereIPE qu’apparaisse la densité correspondant a la matière sélectionnée qui se trouve 2 colonnes à coté de la matière (colonne C dans ma table excel)

J'utilise un code qui me renvoie "une erreur de type":

Private Sub ComboBoxMatiereIPE_Change()

 Dim I As Integer
  Dim Ws As Worksheet
  Dim Cel As Range

    If Me.ComboBoxMatiereIPE.ListIndex = -1 Then Exit Sub
           Set Ws = Sheets("Propriétés poutrelles.xls")
            TextBoxDensiteIPE = Ws.Cells(Me.ComboBoxMatiereIPE.Column(1), "C").Value

End Sub

En PJ mon fichier

Saurriez vous m'aider à résoudre ce probleme svp

Cdt Bruno

Essayes ca et dis moi si cela te convient :

Public Sub ComboBoxMatiereIPE_Change()

 Dim I As Integer
  Dim Ws As Worksheet
  Dim Cel As Range
  Dim densite As String

    If Me.ComboBoxMatiereIPE.ListIndex = -1 Then Exit Sub
           Set Ws = Sheets("Propriétés poutrelles.xls")
            densite = Ws.Range("A3", "A5").Find(Me.ComboBoxMatiereIPE.Column(0)).Offset(0, 2).Value

            TextBoxDensiteIPE = densite

End Sub

Damien

Parfait Merci beaucoup !!!!!!!!!

Rechercher des sujets similaires à "remplir textbox valeur correspondant listbox"