Merci
@Gégé-45550 , je comprends mais je vois pas trop où et comment ?
La macro:
Private Sub CommandButton2_Click()
Dim nf As String
deb = "FC" & Right(Year(Now), 2) & Right(Month(Now) + 100, 2) & "-"
On Error Resume Next
canal = FreeFile
Open chemin & "C:\Test\num.txt" For Input As #canal
Input #canal, nf
Close #canal
If Left(nf, 7) = deb Then
nf = deb & Format(Val(Right(nf, 2) + 1), "00")
Else
nf = CStr(deb & "01")
End If
Open chemin & "C:\Test\num.txt" For Output As #canal
Print #canal, nf
Close #canal
Sheets("Test").[E4] = nf
End Sub