Private Sub Workbook_Open()
On Error Resume Next ' si pas de cr?ation de nom
If Month(Date) <> CLng(Mid([lenum], 5, 2)) Or Year(Date) <> CLng(Left([lenum], 4)) Then
ActiveWorkbook.Names.Add Name:="LeNum", RefersTo:=Format(Date, "yyyymm-001")
Else
ActiveWorkbook.Names.Add Name:="LeNum", RefersTo:=Format(Date, "yyyymm-") & Format((Right([lenum], 3) + 1), "000")
End If
Feuil1.[d3] = [lenum] ' adapter le CodeName de la feuille
End Sub