Bonjour a tous,
Je souhaiterais que quand je click sur le bouton "MODIFY" pour valider les valeurs, cela m'amene a la ligne correspondante qui est surlignee bleu dans la LISTBOX20.
Private Sub CommandButton8_Click()
Dim ligne As Integer
Dim TS As ListObject
Dim i As Integer
Dim LO
Set TS = Sheets("SV").ListObjects(1)
If ListBox20.ListIndex = -1 Then Exit Sub
'trouver ligne correspondant à combobox1
ligne = WorksheetFunction.Match(ListBox20.List(ListBox20.ListIndex, 0), TS.ListColumns(1).DataBodyRange, 0)
With TS
For i = 2 To 27 'on part de la combobox2 pour compléter colonnes 2 à 27
.DataBodyRange(ligne, i).Value = Me.Controls("Combobox" & i).Value
Next i
For i = 27 To 31 'compléter colonnes 27 à 31
.DataBodyRange(ligne, i + 1).Value = Me.Controls("Textbox" & i).Value
Next i
End With
MsgBox "modification done!"
UserForm_Initialize
ListBox20.TopIndex = Application.Max(r - 25, 0)
'ListBox20.TopIndex = ListBox20.ListIndex - 0
End Sub
Pouvez-vous m'aider ?
En vous remerciant,
a+