Re
Bon je cris au désespoir, j'arrive plus ou moins à obtenir ce que je souhaite avec cette fonction, mais les titres que je devrais obtenir ne fonctionne pas exemple :
Pour le nom de la création de fichier si inexistant je devrais obtenir : Range(G11) DEVIS Range (H8), or j'obtiens juste DEVIS
Pour les feuilles en XLS j'obtiens juste DEVIS - 29/03/2015
Pour la feuille en PDF sa fonctionne bien
Là j'arriverais pas à m'en sortir
Sub ENREGISTRER()
Dim Path As String
Dim File As String
Application.ScreenUpdating = False
Sheets(Array("DDE DEVIS", "NETTOYAGE", "data")).Copy
File = "C:\Users\jno\Documents\Devis"
Path = "C:\Users\jno\Documents\Devis" & "\" & Range("G11").Value & "DEVIS" & Range("H8").Value
'Teste si le repertoire existe sinon creation
If Len(Dir(Path, vbDirectory)) = 0 Then
MkDir (File & "\" & Range("G11").Value & "DEVIS" & Range("H8").Value)
End If
'sauvegarde du fichier Excel
With ActiveWorkbook
.SaveAs Filename:=Path & "\" & "DEVIS" & " " & Range("G11").Value & " " & Range("H8").Value & " - " & Format(Date, "dd-mm-yy") & ".xls"
.Close
Sheets("NETTOYAGE").ExportAsFixedFormat Type:=xlTypePDF, Filename:=Path & "\" & "DEVIS" & " " & Range("G11").Value & " " & Range("H8").Value & " - " & Format(Date, "dd-mm-yy") & ".pdf", Quality:= _
xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
From:=1, To:=2, OpenAfterPublish:=False
End With
End Sub