Bonjour,
J'ai un problème sur ce code :
Private Sub OK_Click()
If choix_act = "" Then
erreur = MsgBox("Veuillez choisir une activité à modifier", vbOKOnly + vbCritical, "OUPS")
End If
Dim i As Integer
' Déclaration de variable
If choix_act.ListIndex = -1 Then
Exit Sub
End If
'Avant de chercher, on vérifie que quelque chose est bien séléctionné dans le Combobox
For i = 2 To Sheets("Abonnements").Range("A65536").End(xlUp).Row
If Sheets("Abonnements").Cells(i, 1).Value = choix_act.Text Then
With ADM
.MODIFICATION = True
.Act.Text = Sheets("Abonnements").Cells(i, 1).Value
If Sheets("Abonnements").Cells(i, 2).Value <> vbNullString Then
.case1.Value = False: .prix1.Text = Sheets("Abonnements").Cells(i, 2).Value
End If
If Sheets("Abonnements").Cells(i, 3).Value <> vbNullString Then
.case2.Value = False: .prix2.Text = Sheets("Abonnements").Cells(i, 3).Value
End If
If Sheets("Abonnements").Cells(i, 4).Value <> vbNullString Then
.case3.Value = False: .prix3.Text = Sheets("Abonnements").Cells(i, 4).Value
End If
If Sheets("Abonnements").Cells(i, 5).Value <> vbNullString Then
.case4.Value = False: .prix4.Text = Sheets("Abonnements").Cells(i, 5).Value
End If
If Sheets("Abonnements").Cells(i, 6).Value <> vbNullString Then
.case5.Value = False: .prix5.Text = Sheets("Abonnements").Cells(i, 6).Value
End If
.MODIFICATION = False
.Show
End With
Exit For
End If
Next i
Unload Me
End Sub
En fait la ligne ne se modifie pas mais s'ajoute.
Qu'est ce que je peux rajouter?
Merci de votre aide.
