A1 -A2 -A3
Dim nom, chemin As String, t
Dim x, i As Integer
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
i = 1
For x = 2 To 4
i = i + 1
nom = "Journal du " & ActiveSheet.Range("A" & i)
t = Timer + 0.5: Do Until Timer > t: DoEvents: Loop
chemin = "C:\JOURNAL\LIGHT\"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=chemin & nom & ".pdf", _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
From:=1, To:=1, OpenAfterPublish:=False
Next x
Cancel = True
End Sub
Option Explicit
Sub PDF_colonne_a()
' chemin adapter...
Range("a1:a" & Cells(Rows.Count, "a").End(xlUp).Row).ExportAsFixedFormat Type:=xlTypePDF, _
Filename:="C:\Users\00\Downloads\" & Range("a1") & Range("a2") & Range("a3") & ".pdf", _
Quality:=xlQualityStandard, IncludeDocProperties:=False, IgnorePrintAreas:=False, OpenAfterPublish:=False
End Sub
Private Function NomFichierValide(sChaine As String) As Boolean
Dim i As Long
Const CaracInterdits As String = """*/:<>?[\]|"
NomFichierValide = True
If Len(sChaine) = 0 Then
NomFichierValide = False
Exit Function
End If
For i = 1 To Len(CaracInterdits)
If InStr(sChaine, Mid$(CaracInterdits, i, 1)) > 0 Then
NomFichierValide = False
Exit Function
End If
Next i
End Function