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 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
| '-------------Recherche suivant numéro de pvc ------------------------------------------------------'
If tip = "Numéro de PVC" Then
Worksheets("Liste des GAC & PVC Mont").Select
i = 2
Do Until i = 0
If Cells(i, 1) = num Then
Workbooks.Open Filename:=Cells(i, 8)
If pvp = "Vrai" Or imptout = "Vrai" Then
For Each Sh In ThisWorkbook.Worksheets
If InStr("Fiche Préparation", Sh.Name) > 0 Then Worksheets("Fiche Préparation").Select
Next Sh
ActiveSheet.Unprotect ("METHFAB")
If of = "" Then
Range("N4") = ("XXXXXXXXXXXXXXX")
MsgBox ("L'OF n'est pas valide")
ActiveWorkbook.Saved = True
ActiveWorkbook.Close
Else
Range("K5") = lot
Range("N4") = of
Range("N5") = ID
ActiveSheet.Protect ("METHFAB") 'DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, AllowInsertingColumns:=True, AllowInsertingRows _
:=True, AllowInsertingHyperlinks:=True, AllowDeletingColumns:=True, _
AllowDeletingRows:=True, AllowSorting:=True, AllowFiltering:=True, _
AllowUsingPivotTables:=True
'----- Bloc pied page----'
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.RightFooter = "N°PVC : " & Range("I3") & Chr(10) & Range("N4") 'passe à la ligne avec Chr(10)'
End With
'----- Fin Bloc pied page----'
ActiveWindow.SelectedSheets.PrintOut Copies:=1
If imptout = "Faux" Then
ActiveWorkbook.Saved = True
ActiveWorkbook.Close
End If
End If
End If
If pvm = "Vrai" Or imptout = "Vrai" Then
Worksheets("Fiche Montage").Select
ActiveSheet.Unprotect ("METHFAB")
If of = "" Then
Range("O4") = ("XXXXXXXXXXXXXXX")
MsgBox ("L'OF n'est pas valide")
ActiveWorkbook.Saved = True
ActiveWorkbook.Close
Else
Range("C5") = lot
Range("O4") = of
Range("O5") = ID
ActiveSheet.Protect ("METHFAB") 'DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, AllowInsertingColumns:=True, AllowInsertingRows _
:=True, AllowInsertingHyperlinks:=True, AllowDeletingColumns:=True, _
AllowDeletingRows:=True, AllowSorting:=True, AllowFiltering:=True, _
AllowUsingPivotTables:=True
'----- Bloc pied page----'
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.RightFooter = "N°PVC : " & Range("H3") & Chr(10) & Range("O4") 'passe à la ligne avec Chr(10)'
End With
'----- Fin Bloc pied page----'
ActiveWindow.SelectedSheets.PrintOut Copies:=1
If imptout = "Faux" Then
ActiveWorkbook.Saved = True
ActiveWorkbook.Close
End If
End If
End If
If pve = "Vrai" Or imptout = "Vrai" Then
Worksheets("Fiche Essais").Select
ActiveSheet.Unprotect ("METHFAB")
If of = "" Then
Range("O4") = ("XXXXXXXXXXXXXXX")
MsgBox ("L'OF n'est pas valide")
ActiveWorkbook.Saved = True
ActiveWorkbook.Close
Else
Range("C5") = lot
Range("O4") = of
Range("O5") = ID
ActiveSheet.Protect ("METHFAB") 'DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, AllowInsertingColumns:=True, AllowInsertingRows _
:=True, AllowInsertingHyperlinks:=True, AllowDeletingColumns:=True, _
AllowDeletingRows:=True, AllowSorting:=True, AllowFiltering:=True, _
AllowUsingPivotTables:=True
'----- Bloc pied page----'
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.RightFooter = "N°PVC : " & Range("H3") & Chr(10) & Range("O4") 'passe à la ligne avec Chr(10)'
End With
'----- Fin Bloc pied page----'
ActiveWindow.SelectedSheets.PrintOut Copies:=1
If imptout = "Faux" Then
ActiveWorkbook.Saved = True
ActiveWorkbook.Close
End If
End If
End If
i = -1
Else
If Cells(i - 1, 1) = "" Or num = "" Then
MsgBox ("il n'y a pas de PVC pour ce numéro de PVC")
i = -1
End If
End If
i = i + 1
Loop
End If
If imptout = "Vrai" Then
ActiveWorkbook.Saved = True
ActiveWorkbook.Close
End If |
Partager