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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
| Sub boucle()
Actif = sheets("Extraction").Range("C4:C107")
For Each Cell In Actif
PDF_All CStr(Cell(1, 1).Value)
Next Cell
End Sub
Sub PDF_All(Actif As String)
autECLSession.autECLPS.SendKeys Actif
Dim NbCopy As Integer
Dim debut As Integer
Dim fin As Integer
Dim TamponProp As Boolean
Dim PDFFileName As String
Dim myPath As String
myPath = ThisWorkbook.Path
Application.ScreenUpdating = False
sheets("Base des paramètres").Select
sheets("Base des paramètres").Range(Cells(5, 2 + i), Cells(299, 2 + i)).Copy
sheets("Extraction").Range("E1").PasteSpecial _
Paste:=xlPasteValues
PDFFileName = myPath & "\" & sheets("Extraction").Range("E23").Value & " - " & sheets("Extraction").Range("E3")
If shtExtraction.Range("E187").Value = 12 And shtExtraction.Range("E19").Value = "CE" Then
sheets(Array("Fiche 0", "Fiche 2", "Fiche 3", "Fiche 4", "Fiche 5", "Fiche 6", "Eval 1", "12 ans")).Select
Else
If shtExtraction.Range("E187").Value = 12 And shtExtraction.Range("E19").Value = "Actu." Then
sheets(Array("Fiche 0", "Eval 1", "12 ans")).Select
Else
If shtExtraction.Range("E19").Value = "CE" Then
sheets(Array("Fiche 0", "Fiche 2", "Fiche 3", "Fiche 4", "Fiche 5", "Fiche 6", "Eval 1", "Eval 2")).Select
Else
sheets(Array("Fiche 0", "Eval 1", "Eval 2")).Select
End If
End If
End If
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=PDFFileName, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
shtExtraction.Select
shtExtraction.Range("E1:E299").ClearContents
shtExtraction.Range("E2").Select
shtExtraction.Select
shtExtraction.Range("A1").Select
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub |
Partager