Sub CommandButton1_Click()
fichier = ThisWorkbook.Name
Dim nf As String
deb = Right(Year(Now), 2) & Right(Month(Now) + 100, 2)
chemin = ThisWorkbook.Path
On Error Resume Next
canal = FreeFile
Open chemin & "\N°facture.txt" For Input As #canal
Input #canal, nf
Close #canal
If Left(nf, 4) = deb Then
nf = CStr(deb & Right(nf + 1001, 3))
Else
nf = CStr(deb & "001")
End If
Open chemin & "\N°facture.txt" For Output As #canal
Copy #canal
Close #canal
Paste [Facture N°!D5]
End Sub