Je ne comprends pas lorsque tu me dis de préciser la propriété utilisée
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionOption Explicit Dim WS As Worksheet Dim Membre As String Dim rgan As Range WS = Sheet1 Private Sub Add_Click() Dim CTRL As Control Dim i As Integer Dim Response As Byte If Me.ComboBox1.ListIndex = -1 Then Exit Sub End If Response = MsgBox("Are yo sure of your data?)", vbQuestion + vbOKCancel) If Response = 1 Then With WS .Range("B" & Me.ComboBox1.ListIndex + 2) = TextBox1 .Range("C" & Me.ComboBox1.ListIndex + 2) = TextBox2 .Range("D" & Me.ComboBox1.ListIndex + 2) = TextBox3 End With MsgBox "Implementation done", vbInformation Ini End Sub Private Sub Cancel_Click() Unload Me Sheet1.Activate End Sub Private Sub ComboBox1_Click() If Me.ComboBox1.ListIndex = -1 Then Exit Sub TextBox1 = WS.Range("B" & Me.ComboBox1.ListIndex + 2) TextBox2 = WS.Range("C" & Me.ComboBox1.ListIndex + 2) TextBox3 = WS.Range("D" & Me.ComboBox1.ListIndex + 2) With Me Membre = .ComboBox1 End With End Sub Private Sub UserForm_Initialize() Sheet1.AutoFilterMode = False Ini End Sub Private Sub Ini() Dim CTRL As Control Dim L As Integer Dim i As Integer For Each CTRL In Me.Controls If TypeOf CTRL Is MSForms.TextBox Or TypeOf CTRL Is MSForms.ComboBox Then CTRL = "" End If Next CTRL Me.ComboBox1.Clear Set WS = ThisWorkbook.Sheets("sheet1") L = WS.Range("A65536").End(xlUp).Row For i = 2 To L With Me.ComboBox1 .AddItem WS.Range("A" & i) End With Next i Application.ScreenUpdating = True End Sub
WS = Sheet1
en effet, je me suis inspiré d'idées sur des forums pour créer mon code vu que je ne savais pas comment utiliser une combobox pour que la réponse de la combobox définisse la ligne où les données doivent être exportées.