Private Sub UserForm_Initialize()
Dim i As Byte 'déclare la variable I (incrément)
Set O = Sheets("BDD") 'définit l'onglet O
'définit la première ligne vide PLV de la colonne 1 (=A) (2 si A2 est vide, sinon la première ligne vide rencontrée)
PLV = IIf(O.Range("A2").Value = "", 2, O.Range("A1").End(xlDown).Row + 1)
'####### modifs pmo
Dim A$
Dim Num&
A$ = Right(CStr(Sheets("BDD").Range("B65000").End(xlUp).Rows), 4)
If IsNumeric(CLng(A$)) Then
Num& = CLng(A$) + 1
A$ = CStr(Num&)
Do Until Len(A$) = 4
A$ = "0" & A$
Loop
A$ = Year(Now) & A$
A$ = "NCE" & Mid(A$, 3)
End If
If A$ <> "" Then TextBox2.Value = A$
'#######
Me.TextBox3.Value = DateSerial(Year(Date), Month(Date), Day(Date)) 'place la date du jour dans la TextBox3
End Sub