1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
Sub Essai()
Dim Chemin As String
Dim Nom As String
Chemin = "C:\"
Nom = "TEXTE TES " & MaDateEnTxt(CDate("15/08/2015"), True) & " " & "LETTRAGE"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Chemin & Nom
', Quality:=xlQualityMinimum, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
End Sub
Function MaDateEnTxt(ByVal DateChoisie As Date, ByVal DateInversee As Boolean) As String
Dim Madate As Variant
Application.Volatile
Madate = Split(DateChoisie, "/")
If DateInversee = False Then
MaDateEnTxt = Madate(0) & "-" & Madate(1) & "-" & Madate(2) 'Jour-Mois-Année
Else
MaDateEnTxt = Madate(2) & "-" & Madate(1) & "-" & Madate(0) 'Année-Mois-Jour
End If
End Function |
Partager