Bonjour wachoo et le forum,
J'ai regardé ton code et je te propose, pour la sauvegarde de modifier celui de ta commande supprimer de la sorte :
Private Sub CmdSupprimer_Click()
Dim CTRL As Control 'Variable pour la collection des controls
Dim i As Integer
Dim Response As Byte
For Each CTRL In Me.Controls
If CTRL = '' Then MsgBox 'Donnée Incomplete', vbCritical, T: CTRL.SetFocus: Exit Sub
Next CTRL
'Ici un message demandant d'accepter la suppression en les listant
Response = MsgBox('Les coordonnées de ' & vbCrLf & vbCrLf & _
'Nom : ' & vbTab & vbTab & ComboBox1 & vbCrLf & vbCrLf & _
'New Prénom : ' & vbTab & TextBox1 & vbCrLf & vbCrLf & _
'New Adresse : ' & vbTab & TextBox2 & vbCrLf & vbCrLf & _
'New C/Postal : ' & vbTab & ComboBox2 & vbCrLf & vbCrLf & _
'Vont être définitivement Supprimées ? ', vbCritical + vbOKCancel, T & ' SUPPRESSION de : ' & Nom)
'Si Réponse OK on continue
If Response = 1 Then
Application.ScreenUpdating = False
'ici avec la Feuille on va faire :
With WS
.Rows(Me.ComboBox1.ListIndex + 2).EntireRow.Copy
Sheets('Données').Activate
Range('A65536').End(xlUp).Select
If Not IsEmpty(Selection) Then Selection.Range('A2').Select
ActiveSheet.Paste
Sheets('database').Activate
.Rows(Me.ComboBox1.ListIndex + 2).EntireRow.Delete
End With
Application.ScreenUpdating = True
'On evoie un message de confirmation
MsgBox 'Opération accomplie', vbInformation, T
Ini 'On lance la réinitialisation du UserForm (Macro en haut du Module)
'Si Réponse Annulation on envoie un message et on a rien fait
Else: MsgBox 'Opération annulée', vbInformation, T
End If
End Sub
Ce n'est certainement pas la meilleure solution, mais ça pourra répondre à ta demande, je pense...
Amicalement
Lionel