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 31 32 33 34
| Sub A_creation_PDF()
Dim sNomFichier As String
Dim i As Long
Dim rep03, nom_societe, s_rep, s_s_rep_nom, def_nom As String
Application.ScreenUpdating = False ' bloc de defilement ecran
For i = 4 To 8
rep03 = Feuil6.Cells(5, 2).Value
nom_societe = Feuil1.Cells(1, 5).Value & "-" & Feuil1.Cells(1, 4).Value & "-tous les fichiers"
s_rep = "01-Les fichiers PDF clients"
s_s_rep_nom = Feuil1.Cells(i, 39).Value
def_nom = Feuil1.Cells(i, 38).Value & "_BC_" & Feuil1.Cells(i, 3).Value
'def_nom = "fichier N°" & i - 3 ' pour essai fonction
sNomFichier = rep03 & "\" & nom_societe & "\" & s_rep & "\" & s_s_rep_nom & "\" & def_nom & ".pdf" ' creation du chemin et du nom
Sheets(3).Activate
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=sNomFichier, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Next i
End Sub |
Partager