Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.56 KB | None | 0 0
  1. LASER CODE
  2.  
  3. Private Sub CommandButton1_Click()
  4. ThisWorkbook.Sheets("LASER DATE").Activate
  5.  
  6. If TPM_ERG.calendartext.value = "78" Then
  7.  
  8. If m_1.value <> "" Or m_2.value = Format(Now, "dd mmmm yyyy") Or m_3.value = Format(Now, "dd mmmm yyyy") Or SPIRAL.m_1.value <> "" And m_2.value = Format(Now, "dd mmmm yyyy") And m_3.value = Format(Now, "dd mmmm yyyy") Then
  9.  
  10. Range("B3") = m_1.value
  11. Range("B4") = m_2.value
  12. Range("B5") = m_3.value
  13. TPM_ERG.lasertextbox1.value = m_1.value
  14. TPM_ERG.lasertextbox2.value = m_2.value
  15. TPM_ERG.lasertextbox3.value = m_3.value
  16.  
  17.  
  18. MsgBox "Data Saved", vbInformation
  19.  
  20. Else
  21. MsgBox "Data Is Empty", vbInformation
  22.  
  23. End If
  24.  
  25. ElseIf TPM_ERG.calendartext.value = "79" Then
  26.  
  27. If m_1.value <> "" Or m_2.value = Format(Now, "dd mmmm yyyy") Or m_3.value = Format(Now, "dd mmmm yyyy") Or SPIRAL.m_1.value <> "" And m_2.value = Format(Now, "dd mmmm yyyy") And m_3.value = Format(Now, "dd mmmm yyyy") Then
  28.  
  29. Range("C3") = m_1.value
  30. Range("C4") = m_2.value
  31. Range("C5") = m_3.value
  32. TPM_ERG.lasertextbox4.value = m_1.value
  33. TPM_ERG.lasertextbox5.value = m_2.value
  34. TPM_ERG.lasertextbox6.value = m_3.value
  35.  
  36.  
  37. MsgBox "Data Saved", vbInformation
  38.  
  39. Else
  40. MsgBox "Data Is Empty", vbInformation
  41.  
  42. End If
  43.  
  44. ElseIf TPM_ERG.calendartext.value = "80" Then
  45.  
  46. If m_1.value <> "" Or m_2.value = Format(Now, "dd mmmm yyyy") Or m_3.value = Format(Now, "dd mmmm yyyy") Or SPIRAL.m_1.value <> "" And m_2.value = Format(Now, "dd mmmm yyyy") And m_3.value = Format(Now, "dd mmmm yyyy") Then
  47.  
  48. Range("D3") = m_1.value
  49. Range("D4") = m_2.value
  50. Range("D5") = m_3.value
  51. TPM_ERG.lasertextbox7.value = m_1.value
  52. TPM_ERG.lasertextbox8.value = m_2.value
  53. TPM_ERG.lasertextbox9.value = m_3.value
  54.  
  55.  
  56. MsgBox "Data Saved", vbInformation
  57.  
  58. Else
  59. MsgBox "Data Is Empty", vbInformation
  60.  
  61. End If
  62.  
  63. ElseIf TPM_ERG.calendartext.value = "81" Then
  64.  
  65. If m_1.value <> "" Or m_2.value = Format(Now, "dd mmmm yyyy") Or m_3.value = Format(Now, "dd mmmm yyyy") Or SPIRAL.m_1.value <> "" And m_2.value = Format(Now, "dd mmmm yyyy") And m_3.value = Format(Now, "dd mmmm yyyy") Then
  66.  
  67. Range("E3") = m_1.value
  68. Range("E4") = m_2.value
  69. Range("E5") = m_3.value
  70. TPM_ERG.lasertextbox10.value = m_1.value
  71. TPM_ERG.lasertextbox11.value = m_2.value
  72. TPM_ERG.lasertextbox12.value = m_3.value
  73.  
  74.  
  75. MsgBox "Data Saved", vbInformation
  76.  
  77. Else
  78. MsgBox "Data Is Empty", vbInformation
  79.  
  80. End If
  81.  
  82. ElseIf TPM_ERG.calendartext.value = "82" Then
  83.  
  84. If m_1.value <> "" Or m_2.value = Format(Now, "dd mmmm yyyy") Or m_3.value = Format(Now, "dd mmmm yyyy") Or SPIRAL.m_1.value <> "" And m_2.value = Format(Now, "dd mmmm yyyy") And m_3.value = Format(Now, "dd mmmm yyyy") Then
  85.  
  86. Range("F3") = m_1.value
  87. Range("F4") = m_2.value
  88. Range("F5") = m_3.value
  89. TPM_ERG.lasertextbox13.value = m_1.value
  90. TPM_ERG.lasertextbox14.value = m_2.value
  91. TPM_ERG.lasertextbox15.value = m_3.value
  92.  
  93.  
  94. MsgBox "Data Saved", vbInformation
  95.  
  96. Else
  97. MsgBox "Data Is Empty", vbInformation
  98.  
  99. End If
  100.  
  101. ElseIf TPM_ERG.calendartext.value = "83" Then
  102.  
  103. If m_1.value <> "" Or m_2.value = Format(Now, "dd mmmm yyyy") Or m_3.value = Format(Now, "dd mmmm yyyy") Or SPIRAL.m_1.value <> "" And m_2.value = Format(Now, "dd mmmm yyyy") And m_3.value = Format(Now, "dd mmmm yyyy") Then
  104.  
  105. Range("G3") = m_1.value
  106. Range("G4") = m_2.value
  107. Range("G5") = m_3.value
  108. TPM_ERG.lasertextbox16.value = m_1.value
  109. TPM_ERG.lasertextbox17.value = m_2.value
  110. TPM_ERG.lasertextbox18.value = m_3.value
  111.  
  112.  
  113. MsgBox "Data Saved", vbInformation
  114.  
  115. Else
  116. MsgBox "Data Is Empty", vbInformation
  117.  
  118. End If
  119.  
  120.  
  121. End If
  122. End Sub
  123.  
  124. Private Sub CommandButton2_Click()
  125. ThisWorkbook.Sheets("LASER DATE").Activate
  126.  
  127. If TPM_ERG.calendartext.value = "78" Then
  128.  
  129. Range("B3").value = ""
  130. Range("B4").value = ""
  131. Range("B5").value = ""
  132.  
  133. TPM_ERG.lasertextbox1.value = ""
  134. TPM_ERG.lasertextbox2.value = ""
  135. TPM_ERG.lasertextbox3.value = ""
  136.  
  137. m_1.value = ""
  138. m_2.value = ""
  139. m_3.value = ""
  140.  
  141. MsgBox "Data Clear", vbInformation
  142.  
  143. ElseIf TPM_ERG.calendartext.value = "79" Then
  144.  
  145. Range("C3").value = ""
  146. Range("C4").value = ""
  147. Range("C5").value = ""
  148.  
  149. TPM_ERG.lasertextbox4.value = ""
  150. TPM_ERG.lasertextbox5.value = ""
  151. TPM_ERG.lasertextbox6.value = ""
  152.  
  153. m_1.value = ""
  154. m_2.value = ""
  155. m_3.value = ""
  156.  
  157. MsgBox "Data Clear", vbInformation
  158.  
  159. ElseIf TPM_ERG.calendartext.value = "80" Then
  160.  
  161. Range("D3").value = ""
  162. Range("D4").value = ""
  163. Range("D5").value = ""
  164.  
  165. TPM_ERG.lasertextbox7.value = ""
  166. TPM_ERG.lasertextbox8.value = ""
  167. TPM_ERG.lasertextbox9.value = ""
  168.  
  169. m_1.value = ""
  170. m_2.value = ""
  171. m_3.value = ""
  172.  
  173. MsgBox "Data Clear", vbInformation
  174.  
  175. ElseIf TPM_ERG.calendartext.value = "81" Then
  176.  
  177. Range("E3").value = ""
  178. Range("E4").value = ""
  179. Range("E5").value = ""
  180.  
  181. TPM_ERG.lasertextbox10.value = ""
  182. TPM_ERG.lasertextbox11.value = ""
  183. TPM_ERG.lasertextbox12.value = ""
  184.  
  185. m_1.value = ""
  186. m_2.value = ""
  187. m_3.value = ""
  188.  
  189. MsgBox "Data Clear", vbInformation
  190.  
  191. ElseIf TPM_ERG.calendartext.value = "82" Then
  192.  
  193. Range("F3").value = ""
  194. Range("F4").value = ""
  195. Range("F5").value = ""
  196.  
  197. TPM_ERG.lasertextbox13.value = ""
  198. TPM_ERG.lasertextbox14.value = ""
  199. TPM_ERG.lasertextbox15.value = ""
  200.  
  201. m_1.value = ""
  202. m_2.value = ""
  203. m_3.value = ""
  204.  
  205. MsgBox "Data Clear", vbInformation
  206.  
  207. ElseIf TPM_ERG.calendartext.value = "83" Then
  208.  
  209. Range("G3").value = ""
  210. Range("G4").value = ""
  211. Range("G5").value = ""
  212.  
  213. TPM_ERG.lasertextbox16.value = ""
  214. TPM_ERG.lasertextbox17.value = ""
  215. TPM_ERG.lasertextbox18.value = ""
  216.  
  217. m_1.value = ""
  218. m_2.value = ""
  219. m_3.value = ""
  220.  
  221. MsgBox "Data Clear", vbInformation
  222.  
  223. End If
  224.  
  225. End Sub
  226.  
  227.  
  228. Private Sub m_1_Enter()
  229. m_1.value = " "
  230.  
  231. ThisWorkbook.Sheets("Sheet1").Activate
  232. Range("A1").Select
  233.  
  234. frmCalendar.Show_Cal
  235. End Sub
  236.  
  237. Private Sub m_btn_finish_Click()
  238.  
  239. If m_1.value <> "" Then
  240.  
  241. m_3.value = Format(Now, "dd mmmm yyyy")
  242.  
  243.  
  244. Else
  245.  
  246. MsgBox "Plan Is Empty ", vbInformation
  247.  
  248. End If
  249.  
  250. End Sub
  251.  
  252. Private Sub m_btn_start_Click()
  253.  
  254. If m_1.value <> "" Then
  255.  
  256. m_2.value = Format(Now, "dd mmmm yyyy")
  257.  
  258. Else
  259.  
  260. MsgBox "Plan Is Empty ", vbInformation
  261.  
  262. End If
  263.  
  264.  
  265. End Sub
  266.  
  267.  
  268. Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
  269. m_1.value = ""
  270. m_2.value = ""
  271. m_3.value = ""
  272. mach_EE.value = ""
  273.  
  274. ThisWorkbook.Sheets("MAINTENANCE SKILL").Activate
  275.  
  276. If Range("B21").value = "99,1%" Then
  277. Range("B21").value = "100%"
  278.  
  279.  
  280. ElseIf Range("C21").value = "99,1%" Then
  281. Range("C21").value = "100%"
  282.  
  283.  
  284. ElseIf Range("D21").value = "99,1%" Then
  285. Range("D21").value = "100%"
  286.  
  287.  
  288. ElseIf Range("E21").value = "99,1%" Then
  289. Range("E21").value = "100%"
  290.  
  291.  
  292. ElseIf Range("F21").value = "99,1%" Then
  293. Range("F21").value = "100%"
  294. End If
  295.  
  296.  
  297.  
  298.  
  299. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement