Bonjour à tous,
Remplace le code de "ComboBox1_Change" par celui-ci :
Private Sub ComboBox1_Change()
Dim x As Long
If ComboBox1.Value <> "" Then
Sheets("Base").Activate
N°dedossier = Cells(ComboBox1.ListIndex + 2, 2)
Civilite = Cells(ComboBox1.ListIndex + 2, 3)
Nom = Cells(ComboBox1.ListIndex + 2, 4)
Prenom = Cells(ComboBox1.ListIndex + 2, 5)
Cells.Find(what:=N°dedossier, lookat:=xlPart).Activate
End If
End Sub
Et le code de "CommandButton6_Click" par celui-ci :
Private Sub CommandButton6_Click()
rep = MsgBox("Etes vous sûr de vouloir supprimer la fiche?", vbYesNo)
If rep = vbNo Then Exit Sub
With Sheets("Base").Range("B2:B" & [B65536].End(xlUp).Row)
Set c = .Find(N°dedossier, lookat:=xlPart)
If Not c Is Nothing Then
c.Select
With ActiveCell
ComboBox1.Value = ""
Range(Cells(.Row, "B"), Cells(.Row, "E")).Delete Shift:=xlUp
End With
End If
End With
num = Sheets("Archives").Range("C65536").End(xlUp).Row + 1
Sheets("Archives").Activate
Range("B" & num).Value = N°dedossier
Range("C" & num).Value = Civilite
Range("D" & num).Value = Nom
Range("E" & num).Value = Prenom
End Sub