Bonjour
J'ai un formulaire avec textbox, Combobox qui fonctionne très bien, mais je voudrais pouvoir modifier les lignes avec un code VBa mais il y a un message d'erreur "Objet Requis "
Voici mon code:
Private Sub CommandButton2_Click()
Dim CTRL As Control 'Variable pour la collection des controls
Dim i As Integer
Dim Response As Byte
Response = MsgBox("Acceptez vous les changements ? ", vbQuestion + vbOKCancel, T & " Modification de : " & Nom)
If Response = 1 Then
With WS
.Range("A" & Me.ComboBox1.ListIndex + 4) = TextBox1
.Range("B" & Me.ComboBox1.ListIndex + 4) = TextBox2
.Range("C" & Me.ComboBox1.ListIndex + 4) = TextBox3
.Range("D" & Me.ComboBox1.ListIndex + 4) = TextBox4
.Range("E" & Me.ComboBox1.ListIndex + 4) = TextBox5
.Range("F" & Me.ComboBox1.ListIndex + 4) = TextBox6
.Range("G" & Me.ComboBox1.ListIndex + 4) = TextBox7
.Range("H" & Me.ComboBox1.ListIndex + 4) = TextBox8
.Range("I" & Me.ComboBox1.ListIndex + 4) = TextBox9
.Range("J" & Me.ComboBox1.ListIndex + 4) = TextBox10
.Range("K" & Me.ComboBox1.ListIndex + 4) = TextBox11
.Range("L" & Me.ComboBox1.ListIndex + 4) = TextBox11
' Idem
End With
MsgBox "Opération accomplie", vbInformation, T
Else: MsgBox "Opération annulée", vbInformation, T
End If
End Sub
Je joint mon fichier qui seras plus explicite
Cordialement
Max