Private Sub valid_Click()
Dim x&
With Worksheets("Intersecur2021")
.Unprotect
dlg = DerLigne(.Range("A3"))
.Cells(dlg + 1, 1) = DateIN
.Cells(dlg + 1, 2) = NAN
.Cells(dlg + 1, 5) = UDI
.Cells(dlg + 1, 6) = IHM
.Cells(dlg + 1, 7) = TypInc
.Cells(dlg + 1, 8) = RG
.Cells(dlg + 1, 10) = Refsec
.Cells(dlg + 1, 11) = Date
DIRI = .Cells(dlg + 1, 9) ' affectation var. pour desti E mail
Rsec = Val(Refsec) ' variable pour référence Securite dans E mail
.Range("A4:W1000").Locked = True
'.Range("A4" & ":W" & dlg + 1).Locked = True
.Protect
End With
'Call envoimail
x = MsgBox("Autre saisie de fiche ?", vbYesNo)
If x = vbNo Then
Worksheets("Intersecur2021").Activate
Unload UserForm1
Else
DateIN.Value = "": NAN.Value = "": UDI.Value = "": IHM.Value = "": RG.Value = "": Refsec.Value = "": TypInc.Value = ""
DateIN.SetFocus
End If
End Sub