Option Explicit
Sub Enregister_Sous()
Dim chemin As String, chemin2 As String, an As String, Ndossier As String
Dim Aw As Workbook, Tw As Workbook
On Error Resume Next
Application.ScreenUpdating = False
Set Tw = ThisWorkbook
With Tw.Feuil1
an = .Range("n1").Value
Ndossier = .Range("g10").Value
End With
chemin = "D:\" & an
MkDir chemin
chemin2 = chemin & "\" & Ndossier & "\"
MkDir chemin2
Tw.SaveAs Filename:=chemin2 & Ndossier & " - " & an & ".xlsm", _
FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
Aw = Ndossier & " - " & an & ".xlsm"
Aw = ActiveWorkbook
Aw.Close True
End Sub