Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.51 KB | None | 0 0
  1. WELDING CODE
  2.  
  3. Private Sub CommandButton1_Click()
  4.  
  5. ThisWorkbook.Sheets("WELDING DATE").Activate
  6.  
  7. If TPM_ERG.calendartext.value = "71" Then
  8.  
  9. 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
  10.  
  11. Range("B3") = m_1.value
  12. Range("B4") = m_2.value
  13. Range("B5") = m_3.value
  14. TPM_ERG.weldtextbox1.value = m_1.value
  15. TPM_ERG.weldtextbox2.value = m_2.value
  16. TPM_ERG.weldtextbox3.value = m_3.value
  17.  
  18.  
  19. MsgBox "Data Saved", vbInformation
  20.  
  21. Else
  22. MsgBox "Data Is Empty", vbInformation
  23.  
  24. End If
  25.  
  26. ElseIf TPM_ERG.calendartext.value = "72" Then
  27.  
  28. 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
  29.  
  30. Range("C3") = m_1.value
  31. Range("C4") = m_2.value
  32. Range("C5") = m_3.value
  33. TPM_ERG.weldtextbox4.value = m_1.value
  34. TPM_ERG.weldtextbox5.value = m_2.value
  35. TPM_ERG.weldtextbox6.value = m_3.value
  36.  
  37.  
  38. MsgBox "Data Saved", vbInformation
  39.  
  40. Else
  41. MsgBox "Data Is Empty", vbInformation
  42.  
  43. End If
  44.  
  45. ElseIf TPM_ERG.calendartext.value = "73" Then
  46.  
  47. 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
  48.  
  49. Range("D3") = m_1.value
  50. Range("D4") = m_2.value
  51. Range("D5") = m_3.value
  52. TPM_ERG.weldtextbox7.value = m_1.value
  53. TPM_ERG.weldtextbox8.value = m_2.value
  54. TPM_ERG.weldtextbox9.value = m_3.value
  55.  
  56.  
  57. MsgBox "Data Saved", vbInformation
  58.  
  59. Else
  60. MsgBox "Data Is Empty", vbInformation
  61.  
  62. End If
  63.  
  64. ElseIf TPM_ERG.calendartext.value = "74" Then
  65.  
  66. 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
  67.  
  68. Range("E3") = m_1.value
  69. Range("E4") = m_2.value
  70. Range("E5") = m_3.value
  71. TPM_ERG.weldtextbox10.value = m_1.value
  72. TPM_ERG.weldtextbox11.value = m_2.value
  73. TPM_ERG.weldtextbox12.value = m_3.value
  74.  
  75.  
  76. MsgBox "Data Saved", vbInformation
  77.  
  78. Else
  79. MsgBox "Data Is Empty", vbInformation
  80.  
  81. End If
  82.  
  83. ElseIf TPM_ERG.calendartext.value = "75" Then
  84.  
  85. 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
  86.  
  87. Range("F3") = m_1.value
  88. Range("F4") = m_2.value
  89. Range("F5") = m_3.value
  90. TPM_ERG.weldtextbox13.value = m_1.value
  91. TPM_ERG.weldtextbox14.value = m_2.value
  92. TPM_ERG.weldtextbox15.value = m_3.value
  93.  
  94.  
  95. MsgBox "Data Saved", vbInformation
  96.  
  97. Else
  98. MsgBox "Data Is Empty", vbInformation
  99.  
  100. End If
  101.  
  102. ElseIf TPM_ERG.calendartext.value = "76" Then
  103.  
  104. 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
  105.  
  106. Range("G3") = m_1.value
  107. Range("G4") = m_2.value
  108. Range("G5") = m_3.value
  109. TPM_ERG.weldtextbox16.value = m_1.value
  110. TPM_ERG.weldtextbox17.value = m_2.value
  111. TPM_ERG.weldtextbox18.value = m_3.value
  112.  
  113.  
  114. MsgBox "Data Saved", vbInformation
  115.  
  116. Else
  117. MsgBox "Data Is Empty", vbInformation
  118.  
  119. End If
  120.  
  121. ElseIf TPM_ERG.calendartext.value = "77" Then
  122.  
  123. 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
  124.  
  125. Range("H3") = m_1.value
  126. Range("H4") = m_2.value
  127. Range("H5") = m_3.value
  128. TPM_ERG.weldtextbox19.value = m_1.value
  129. TPM_ERG.weldtextbox20.value = m_2.value
  130. TPM_ERG.weldtextbox21.value = m_3.value
  131.  
  132.  
  133. MsgBox "Data Saved", vbInformation
  134.  
  135. Else
  136. MsgBox "Data Is Empty", vbInformation
  137.  
  138. End If
  139.  
  140. ElseIf TPM_ERG.calendartext.value = "788" Then
  141.  
  142. 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
  143.  
  144. Range("I3") = m_1.value
  145. Range("I4") = m_2.value
  146. Range("I5") = m_3.value
  147. TPM_ERG.weldtextbox22.value = m_1.value
  148. TPM_ERG.weldtextbox23.value = m_2.value
  149. TPM_ERG.weldtextbox24.value = m_3.value
  150.  
  151.  
  152. MsgBox "Data Saved", vbInformation
  153.  
  154. Else
  155. MsgBox "Data Is Empty", vbInformation
  156.  
  157. End If
  158. End If
  159.  
  160. End Sub
  161.  
  162. Private Sub CommandButton2_Click()
  163. ThisWorkbook.Sheets("WELDING DATE").Activate
  164.  
  165. If TPM_ERG.calendartext.value = "71" Then
  166.  
  167. Range("B3").value = ""
  168. Range("B4").value = ""
  169. Range("B5").value = ""
  170.  
  171. TPM_ERG.weldtextbox1.value = ""
  172. TPM_ERG.weldtextbox2.value = ""
  173. TPM_ERG.weldtextbox3.value = ""
  174.  
  175. m_1.value = ""
  176. m_2.value = ""
  177. m_3.value = ""
  178.  
  179. MsgBox "Data Clear", vbInformation
  180.  
  181. ElseIf TPM_ERG.calendartext.value = "72" Then
  182.  
  183. Range("C3").value = ""
  184. Range("C4").value = ""
  185. Range("C5").value = ""
  186.  
  187. TPM_ERG.weldtextbox4.value = ""
  188. TPM_ERG.weldtextbox5.value = ""
  189. TPM_ERG.weldtextbox6.value = ""
  190.  
  191. m_1.value = ""
  192. m_2.value = ""
  193. m_3.value = ""
  194.  
  195. MsgBox "Data Clear", vbInformation
  196.  
  197. ElseIf TPM_ERG.calendartext.value = "73" Then
  198.  
  199. Range("D3").value = ""
  200. Range("D4").value = ""
  201. Range("D5").value = ""
  202.  
  203. TPM_ERG.weldtextbox7.value = ""
  204. TPM_ERG.weldtextbox8.value = ""
  205. TPM_ERG.weldtextbox9.value = ""
  206.  
  207. m_1.value = ""
  208. m_2.value = ""
  209. m_3.value = ""
  210.  
  211. MsgBox "Data Clear", vbInformation
  212.  
  213. ElseIf TPM_ERG.calendartext.value = "74" Then
  214.  
  215. Range("E3").value = ""
  216. Range("E4").value = ""
  217. Range("E5").value = ""
  218.  
  219. TPM_ERG.weldtextbox10.value = ""
  220. TPM_ERG.weldtextbox11.value = ""
  221. TPM_ERG.weldtextbox12.value = ""
  222.  
  223. m_1.value = ""
  224. m_2.value = ""
  225. m_3.value = ""
  226.  
  227. MsgBox "Data Clear", vbInformation
  228.  
  229. ElseIf TPM_ERG.calendartext.value = "75" Then
  230.  
  231. Range("F3").value = ""
  232. Range("F4").value = ""
  233. Range("F5").value = ""
  234.  
  235. TPM_ERG.weldtextbox13.value = ""
  236. TPM_ERG.weldtextbox14.value = ""
  237. TPM_ERG.weldtextbox15.value = ""
  238.  
  239. m_1.value = ""
  240. m_2.value = ""
  241. m_3.value = ""
  242.  
  243. MsgBox "Data Clear", vbInformation
  244.  
  245. ElseIf TPM_ERG.calendartext.value = "76" Then
  246.  
  247. Range("G3").value = ""
  248. Range("G4").value = ""
  249. Range("G5").value = ""
  250.  
  251. TPM_ERG.weldtextbox16.value = ""
  252. TPM_ERG.weldtextbox17.value = ""
  253. TPM_ERG.weldtextbox18.value = ""
  254.  
  255. m_1.value = ""
  256. m_2.value = ""
  257. m_3.value = ""
  258.  
  259. MsgBox "Data Clear", vbInformation
  260.  
  261. ElseIf TPM_ERG.calendartext.value = "77" Then
  262.  
  263. Range("H3").value = ""
  264. Range("H4").value = ""
  265. Range("H5").value = ""
  266.  
  267. TPM_ERG.weldtextbox19.value = ""
  268. TPM_ERG.weldtextbox20.value = ""
  269. TPM_ERG.weldtextbox21.value = ""
  270.  
  271. m_1.value = ""
  272. m_2.value = ""
  273. m_3.value = ""
  274.  
  275. MsgBox "Data Clear", vbInformation
  276.  
  277. ElseIf TPM_ERG.calendartext.value = "788" Then
  278.  
  279. Range("I3").value = ""
  280. Range("I4").value = ""
  281. Range("I5").value = ""
  282.  
  283. TPM_ERG.weldtextbox22.value = ""
  284. TPM_ERG.weldtextbox23.value = ""
  285. TPM_ERG.weldtextbox24.value = ""
  286.  
  287. m_1.value = ""
  288. m_2.value = ""
  289. m_3.value = ""
  290.  
  291. MsgBox "Data Clear", vbInformation
  292. End If
  293. End Sub
  294.  
  295.  
  296. Private Sub m_1_Enter()
  297. m_1.value = " "
  298.  
  299. ThisWorkbook.Sheets("Sheet1").Activate
  300. Range("A1").Select
  301.  
  302. frmCalendar.Show_Cal
  303.  
  304. End Sub
  305.  
  306. Private Sub m_btn_finish_Click()
  307.  
  308. If m_1.value <> "" Then
  309.  
  310. m_3.value = Format(Now, "dd mmmm yyyy")
  311.  
  312.  
  313. Else
  314.  
  315. MsgBox "Plan Is Empty ", vbInformation
  316.  
  317. End If
  318.  
  319. End Sub
  320.  
  321. Private Sub m_btn_start_Click()
  322.  
  323.  
  324. If m_1.value <> "" Then
  325.  
  326. m_2.value = Format(Now, "dd mmmm yyyy")
  327.  
  328. Else
  329.  
  330. MsgBox "Plan Is Empty ", vbInformation
  331.  
  332. End If
  333.  
  334. If m_1.value < m_2.value Then
  335. m_2.ForeColor = RGB(138, 132, 18) 'yellow
  336.  
  337. ElseIf m_1.value > m_2.value Then
  338. m_2.ForeColor = RGB(153, 18, 18) 'red
  339.  
  340. ElseIf m_1.value = m_2.value Then 'green
  341. m_2.ForeColor = RGB(10, 92, 22)
  342.  
  343. End If
  344.  
  345. End Sub
  346.  
  347. Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
  348.  
  349. m_1.value = ""
  350. m_2.value = ""
  351. m_3.value = ""
  352. mach_EE.value = ""
  353.  
  354. ThisWorkbook.Sheets("MAINTENANCE SKILL").Activate
  355.  
  356. If Range("B21").value = "99,1%" Then
  357. Range("B21").value = "100%"
  358.  
  359.  
  360. ElseIf Range("C21").value = "99,1%" Then
  361. Range("C21").value = "100%"
  362.  
  363.  
  364. ElseIf Range("D21").value = "99,1%" Then
  365. Range("D21").value = "100%"
  366.  
  367.  
  368. ElseIf Range("E21").value = "99,1%" Then
  369. Range("E21").value = "100%"
  370.  
  371.  
  372. ElseIf Range("F21").value = "99,1%" Then
  373. Range("F21").value = "100%"
  374. End If
  375.  
  376.  
  377.  
  378.  
  379. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement