Bonjour Guguste ,
Sans m'être beaucoup penché sur le code, passez la déclaration de a() au niveau du module de Userform1 ?
Au lieu de :
Private Sub UserForm_Initialize()
Dim i As Integer, lastline As Integer, line As Integer, c As Range, mot As String, activeline As Integer, Vendor As String, Weight As Currency, Price As Currency, Shipping As Currency
Dim a()
With ComboBox_Composant
.MatchEntry = fmMatchEntryNone
.MatchRequired = True
End With
lastline = Sheets("Composants").Cells(Rows.Count, 1).End(xlUp).Row
a = Application.Transpose(Sheets("Composants").Range(Cells(2, 1), Cells(lastline, 1)))
Me.ComboBox_Composant.List = a
End Sub
Essayez :
Dim a()
Private Sub UserForm_Initialize()
Dim i As Integer, lastline As Integer, line As Integer, c As Range, mot As String, activeline As Integer, Vendor As String, Weight As Currency, Price As Currency, Shipping As Currency
With ComboBox_Composant
.MatchEntry = fmMatchEntryNone
.MatchRequired = True
End With
lastline = Sheets("Composants").Cells(Rows.Count, 1).End(xlUp).Row
a = Application.Transpose(Sheets("Composants").Range(Cells(2, 1), Cells(lastline, 1)))
Me.ComboBox_Composant.List = a
End Sub