Sub copieIII()
'auteur code initial: Justin Labenne
Dim nomfic$, chemin$, OldName$, NewName$
Dim nm As Name
Dim ws As Worksheet
chemin = ThisWorkbook.Path & "\"
nomfic = "Xbesoins"
With Application
On Error GoTo ErrCatcher
Sheets(Array("tot1", "tot2", "tot3", "tot4")).Copy
On Error GoTo 0
For Each ws In ActiveWorkbook.Worksheets
With ws.UsedRange
.Cells = .Cells.Value
End With
ws.Hyperlinks.Delete
Next ws
For Each nm In ActiveWorkbook.Names
nm.Delete
Next nm
ActiveWorkbook.SaveAs (chemin & nomfic & ".xls")
ActiveWorkbook.Close SaveChanges:=False
OldName = chemin & nomfic & ".xls"
NewName = "C:\besoins.xls"
[COLOR=Red][B]Name OldName As NewName ' Déplace et renomme le fichier.[/B][/COLOR]
.ScreenUpdating = True
End With
Exit Sub
ErrCatcher:
MsgBox "Les feuilles à copier n'existent pas!"
End Sub