Sub dossier()
With UserForm1
mois = 1
nom = "AN" & "2014"
chemfich = ThisWorkbook.Path & "\" & nom & ".xlsm"
fich = Dir(chemfich)
If fich <> "" Then
MsgBox "Le fichier " & fich & " Existe déjà" & vbCr & "Abandon de la procédure"
Exit Sub
End If
End With
ActiveWorkbook.SaveCopyAs Filename:=chemfich
Workbooks.Open chemfich
With Workbooks(nom & ".xlsm")
.Sheets("MODÉLE").Visible = True
Application.DisplayAlerts = False
.Sheets("BASE").Delete
Application.DisplayAlerts = True
.Sheets("MODÉLE").Name = nom
.Save
End With
ThisWorkbook.Close SaveChanges:=False
End Sub
Sub ouvreUserANU()
UserForm1.Caption = "Salut"
UserForm1.Show
End Sub