Microsoft 365 Erreur d'execution '5': Argument ou appel de procédure incorrect sur copie vers listBox dans un formulaire

Profane95

XLDnaute Nouveau
Bonjour à tous,
j'ai un formulaire avec différents ComboBox et TextBox je récupère bien les valeurs des différents composants dans ma listbox, mais ça me plante juste après avec cette erreur 5
je vous ai mis une partie du code avec la ligne ou Excel identifie l'erreur
d'avance merci.

Private Sub ComboBoxDescription_Change()

Set d1 = CreateObject("Scripting.Dictionary")
tmp = UCase(Me.ComboBoxDescription) & "*"
For Each c In TblChoix2
If UCase(c) Like tmp Then d1(c) = ""
Next c
Me.ComboBoxDescription.List = d1.keys
Me.ComboBoxDescription.DropDown
rec = Application.Match(Me.ComboBoxDescription, [DescriptionEqpt], 0)
Me.TextBoxReference = Sheets("Ref_Eqpt").Range("Reference")(rec) <<------erreur sur cette ligne
Me.TextBoxTarifUnitaire = Sheets("Ref_Eqpt").Range("TarifUnitaire")(rec)
End Sub

Private Sub CommandButtonAjouter_Click()
With ListBoxChoixEquipements
rec = Application.Match(Me.ComboBoxDescription, [DescriptionEqpt], 0)
.AddItem
.List(ListBoxChoixEquipements.ListCount - 1, 0) = Me.ComboBoxTypeUsage.Value
.List(ListBoxChoixEquipements.ListCount - 1, 1) = Me.ComboBoxDescription.Value
.List(ListBoxChoixEquipements.ListCount - 1, 2) = Sheets("Ref_Eqpt").Range("C" & rec).Value
.List(ListBoxChoixEquipements.ListCount - 1, 3) = Sheets("Ref_Eqpt").Range("D" & rec).Value
.List(ListBoxChoixEquipements.ListCount - 1, 4) = Me.TextBoxQuantite.Value
.List(ListBoxChoixEquipements.ListCount - 1, 5) = Me.TextBoxPrixHT.Value
End With

Me.ComboBoxTypeUsage = Empty
Me.ComboBoxDescription = Empty
Me.TextBoxReference = Empty
Me.TextBoxTarifUnitaire = Empty
Me.TextBoxQuantite = Empty
Me.TextBoxPrixHT = Empty


End Sub
 

Discussions similaires

Réponses
17
Affichages
1 K

Membres actuellement en ligne

Statistiques des forums

Discussions
311 725
Messages
2 081 943
Membres
101 849
dernier inscrit
florentMIG