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
| Sub bordereau_envoi_documents()
Dim j, i As Integer
Dim indice_en_cours
j = 10
i = 25
While j < 2000
If Sheets("SORTIES").Cells(j, 7).Value <> "" Then
Sheets("BORD. ENVOI").Cells(i, 1) = Sheets("SORTIES").Cells(j, 2)
Sheets("BORD. ENVOI").Cells(i, 13) = Sheets("SORTIES").Cells(j, 4)
indice_en_cours = ""
If Sheets("SORTIES").Cells(j, 11) <> "" Then
indice_en_cours = "A"
End If
If Sheets("SORTIES").Cells(j, 17) <> "" Then
indice_en_cours = "B"
End If
If Sheets("SORTIES").Cells(j, 23) <> "" Then
indice_en_cours = "C"
End If
If Sheets("SORTIES").Cells(j, 29) <> "" Then
indice_en_cours = "D"
End If
If Sheets("SORTIES").Cells(j, 35) <> "" Then
indice_en_cours = "E"
End If
If Sheets("SORTIES").Cells(j, 41) <> "" Then
indice_en_cours = "F"
End If
If Sheets("SORTIES").Cells(j, 47) <> "" Then
indice_en_cours = "G"
End If
Sheets("BORD. ENVOI").Cells(i, 19) = indice_en_cours
i = i + 1
End If
j = j + 4
Wend
Sheets("BORD. ENVOI").ExportAsFixedFormat Type:=xlTypePDF, _
Filename:="W:\Exploitation\" & Sheets("DOS. AFF").Range("F13") & "\" & Sheets("DOS. AFF").Range("F14") & "\6 BORDEREAUX D'ENVOI\" & "Bordereau d'envoi n°.pdf", _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=True
Worksheets("BORD. ENVOI").Range("A25:Y36").ClearContents
End Sub |
Partager