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 141 142 143 144 145
| Private Cd As Worksheet, Cr As Worksheet, Ce As Worksheet, Cf As Worksheet
Private Sub Worksheet_Activate()
Set Cd = Worksheets("Check in Exxon")
Set Cr = Worksheets("Escale report")
Set Ce = Worksheets("Airwaybill")
Set Cf = Worksheets("Pax manifest")
End Sub
Sub CommandButton1_Click()
UserForm3.Show
End Sub
Sub CommandButton2_Click()
If MsgBox("Is first PAX arrived?", vbYesNo, "Wait for first PAX...") = vbYes Then
Dim Today1 As Date
Today1 = Time
Me.Caption = Today1
Cr.Range("C20").Value = Today1
End If
MsgBox "First PAX is arrived."
Unload Me
End Sub
Sub CommandButton3_Click()
Dim x As Variant, L As Long
If MsgBox("Check-in is closed?", vbYesNo, "Closing of Check-in") = vbYes Then
Dim Today2
Today2 = Time
Me.Caption = Today2
Cr.Range("C21").Value = Today2
With Cd
.Range("G8").Copy Destination:=Cr.Range("B8")
.Range("G9").Copy Destination:=Cr.Range("B10")
.Range("J5").Copy Destination:=Cr.Range("F8")
.Range("J9").Copy Destination:=Cr.Range("D8")
.Range("C6").Copy Destination:=Cr.Range("H8")
.Range("C5").Copy Destination:=Cr.Range("H6")
.Range("G8").Copy Destination:=Cr.Range("B8")
.Range("G9").Copy Destination:=Cr.Range("B10")
'.Select
.Range("A16:F63").Copy Destination:=Cf.Range("A10:F58")
.Range("E61").Copy
Cr.Range("C13").PasteSpecial Paste:=xlPasteValues
.Range("I62").Copy
Cr.Range("B13").PasteSpecial Paste:=xlPasteValues
.Range("E62").Copy
Cr.Range("B14").PasteSpecial Paste:=xlPasteValues
.Range("E61").Copy
Cr.Range("C14").PasteSpecial Paste:=xlPasteValues
End With
With Cr
Ce.Range("E32").Copy
.Range("B15").PasteSpecial Paste:=xlPasteValues
Ce.Range("F32").Copy
.Range("C15").PasteSpecial Paste:=xlPasteValues
Cf.Range("H62").Copy
.Range("B13").PasteSpecial Paste:=xlPasteValues
Cf.Range("E60").Copy
.Range("C13").PasteSpecial Paste:=xlPasteValues
Cf.Range("E62").Copy
.Range("B14").PasteSpecial Paste:=xlPasteValues
Cf.Range("E63").Copy
.Range("C14").PasteSpecial Paste:=xlPasteValues
Ce.Range("E32").Copy
.Range("B15").PasteSpecial Paste:=xlPasteValues
Ce.Range("F32").Copy
.Range("C15").PasteSpecial Paste:=xlPasteValues
End With
L = Sheets("data").Range("B1:B65536").Find(x, lookat:=xlWhole).Row
With Worksheets("Data")
If .Cells(L, "B").Value = Worksheets("flight following").Range("C5").Value Then
.Cells(L, "AN") = Worksheets("weight sheet").Range("C37").Value
.Cells(L, "AM") = Cf.Range("E60").Value
.Cells(L, "AL") = Cf.Range("H62").Value
.Cells(L, "AO") = Ce.Range("F32").Value
End If
End With
End If
MsgBox "Check-In is closed!"
Unload Me
End Sub
Private Sub CommandButton4_Click()
If MsgBox("Are you sure to print the Documents?", vbYesNo, "Demande de confirmation") = vbYes Then
With Cf.PageSetup
.PrintArea = "A1:H68"
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
Cf.PrintOut Copies:=6
With Ce.PageSetup
.Orientation = xlLandscape
.PrintArea = "A1:Q33"
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
Ce.PrintOut Copies:=5
With Worksheets("Tag sheet Exxon").PageSetup
.PrintArea = "A1:L56"
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
Worksheets("Tag sheet Exxon").PrintOut
With Worksheets("Weight Sheet").PageSetup
.Orientation = xlLandscape
.PrintArea = "A1:Q55"
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
Worksheets("Weight Sheet").PrintOut Copies:=2
End If
Unload Me
End Sub
Private Sub CommandButton5_Click()
If MsgBox("Are you sure to print the report?", vbYesNo, "Demande de confirmation") = vbYes Then
With Cr.PageSetup
.PrintArea = "A1:H37"
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
End If
Cr.PrintOut
Unload Me
End Sub
Private Sub CommandButton6_Click()
If MsgBox("Are you sure to close this flight? This will erase data.", vbYesNo, "Demande de confirmation") = vbYes Then
With Cd
Application.Union(.Range("C5:C12"), .Range("G5:G9"), .Range("L3"), .Range("B16:L63"), .Range("M16:M63"), .Range("J5:J9")).ClearContents
End With
Cf.Range("A10:F57") = ""
Ce.Range("A10:Q31") = ""
With Cr
Application.Union(.Range("B8"), .Range("B10"), .Range("D8"), .Range("D10"), .Range("F8"), .Range("F10"), .Range("H6"), .Range("H8"), .Range("H10"), .Range("B13:C15"), .Range("C18:C21")).ClearContents
End With
End If
Unload Me
End Sub |
Partager