Bonjour,
Tout d'abords, mettre le code de l'évènement "Employee_Change()" dans l'évènement "Employee_Click()" du ComboBox :
Private Sub Employee_Click()
Dim Cel As Range
Dim a As Integer
Dim cherche
cherche = Employee.Value
Set Cel = Sheets("Tampon données").Cells.Find(cherche, , xlValues, xlWhole)
If Cel Is Nothing Then Exit Sub
a = Cel.Row
dateofaccident = Range("A" & a).Offset(0, 1).Value
Department = Range("A" & a).Offset(0, 2).Value
Store = Range("A" & a).Offset(0, 3).Value
Typeofevent = Range("A" & a).Offset(0, 4).Value
Natureofinjury = Range("A" & a).Offset(0, 5).Value
Partofbody = Range("A" & a).Offset(0, 6).Value
description = Range("A" & a).Offset(0, 7).Value
corrective = Range("A" & a).Offset(0, 8).Value
nomresponsable = Range("A" & a).Offset(0, 9).Value
claim = Range("A" & a).Offset(0, 10).Value
allowance = Range("A" & a).Offset(0, 12).Value
loststart = Range("A" & a).Offset(0, 13).Value
lostend = Range("A" & a).Offset(0, 14).Value
Investigation = Range("A" & a).Offset(0, 11).Value
modifiedstart = Range("A" & a).Offset(0, 16).Value
modifiedend = Range("A" & a).Offset(0, 17).Value
dateofreturn = Range("A" & a).Offset(0, 19).Value
nextappointment = Range("A" & a).Offset(0, 20).Value
comments = Range("A" & a).Offset(0, 21).Value
End Sub
Le code d'enregistrement d'un nouveau cas :
Private Sub save_Click()
Dim Ligne
With Worksheets("Tampon données")
Ligne = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
.Cells(Ligne, 1) = Me.Employee
.Cells(Ligne, 2) = Me.dateofaccident
.Cells(Ligne, 3) = Me.Department
.Cells(Ligne, 4) = Me.Store
.Cells(Ligne, 5) = Me.Typeofevent
.Cells(Ligne, 6) = Me.Natureofinjury
.Cells(Ligne, 7) = Me.Partofbody
.Cells(Ligne, 8) = Me.description
.Cells(Ligne, 9) = Me.corrective
.Cells(Ligne, 10) = Me.nomresponsable
.Cells(Ligne, 11) = Me.claim
.Cells(Ligne, 12) = Me.Investigation
.Cells(Ligne, 13) = Me.allowance
.Cells(Ligne, 14) = Me.loststart
.Cells(Ligne, 15) = Me.lostend
.Cells(Ligne, 17) = Me.modifiedstart
.Cells(Ligne, 18) = Me.modifiedend
.Cells(Ligne, 20) = Me.dateofreturn
.Cells(Ligne, 21) = Me.nextappointment
.Cells(Ligne, 22) = Me.comments
Employee.RowSource = .Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)).Address
End With
End Sub