Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WELDING CODE
- Private Sub CommandButton1_Click()
- ThisWorkbook.Sheets("WELDING DATE").Activate
- If TPM_ERG.calendartext.value = "71" Then
- 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
- Range("B3") = m_1.value
- Range("B4") = m_2.value
- Range("B5") = m_3.value
- TPM_ERG.weldtextbox1.value = m_1.value
- TPM_ERG.weldtextbox2.value = m_2.value
- TPM_ERG.weldtextbox3.value = m_3.value
- MsgBox "Data Saved", vbInformation
- Else
- MsgBox "Data Is Empty", vbInformation
- End If
- ElseIf TPM_ERG.calendartext.value = "72" Then
- 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
- Range("C3") = m_1.value
- Range("C4") = m_2.value
- Range("C5") = m_3.value
- TPM_ERG.weldtextbox4.value = m_1.value
- TPM_ERG.weldtextbox5.value = m_2.value
- TPM_ERG.weldtextbox6.value = m_3.value
- MsgBox "Data Saved", vbInformation
- Else
- MsgBox "Data Is Empty", vbInformation
- End If
- ElseIf TPM_ERG.calendartext.value = "73" Then
- 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
- Range("D3") = m_1.value
- Range("D4") = m_2.value
- Range("D5") = m_3.value
- TPM_ERG.weldtextbox7.value = m_1.value
- TPM_ERG.weldtextbox8.value = m_2.value
- TPM_ERG.weldtextbox9.value = m_3.value
- MsgBox "Data Saved", vbInformation
- Else
- MsgBox "Data Is Empty", vbInformation
- End If
- ElseIf TPM_ERG.calendartext.value = "74" Then
- 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
- Range("E3") = m_1.value
- Range("E4") = m_2.value
- Range("E5") = m_3.value
- TPM_ERG.weldtextbox10.value = m_1.value
- TPM_ERG.weldtextbox11.value = m_2.value
- TPM_ERG.weldtextbox12.value = m_3.value
- MsgBox "Data Saved", vbInformation
- Else
- MsgBox "Data Is Empty", vbInformation
- End If
- ElseIf TPM_ERG.calendartext.value = "75" Then
- 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
- Range("F3") = m_1.value
- Range("F4") = m_2.value
- Range("F5") = m_3.value
- TPM_ERG.weldtextbox13.value = m_1.value
- TPM_ERG.weldtextbox14.value = m_2.value
- TPM_ERG.weldtextbox15.value = m_3.value
- MsgBox "Data Saved", vbInformation
- Else
- MsgBox "Data Is Empty", vbInformation
- End If
- ElseIf TPM_ERG.calendartext.value = "76" Then
- 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
- Range("G3") = m_1.value
- Range("G4") = m_2.value
- Range("G5") = m_3.value
- TPM_ERG.weldtextbox16.value = m_1.value
- TPM_ERG.weldtextbox17.value = m_2.value
- TPM_ERG.weldtextbox18.value = m_3.value
- MsgBox "Data Saved", vbInformation
- Else
- MsgBox "Data Is Empty", vbInformation
- End If
- ElseIf TPM_ERG.calendartext.value = "77" Then
- 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
- Range("H3") = m_1.value
- Range("H4") = m_2.value
- Range("H5") = m_3.value
- TPM_ERG.weldtextbox19.value = m_1.value
- TPM_ERG.weldtextbox20.value = m_2.value
- TPM_ERG.weldtextbox21.value = m_3.value
- MsgBox "Data Saved", vbInformation
- Else
- MsgBox "Data Is Empty", vbInformation
- End If
- ElseIf TPM_ERG.calendartext.value = "788" Then
- 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
- Range("I3") = m_1.value
- Range("I4") = m_2.value
- Range("I5") = m_3.value
- TPM_ERG.weldtextbox22.value = m_1.value
- TPM_ERG.weldtextbox23.value = m_2.value
- TPM_ERG.weldtextbox24.value = m_3.value
- MsgBox "Data Saved", vbInformation
- Else
- MsgBox "Data Is Empty", vbInformation
- End If
- End If
- End Sub
- Private Sub CommandButton2_Click()
- ThisWorkbook.Sheets("WELDING DATE").Activate
- If TPM_ERG.calendartext.value = "71" Then
- Range("B3").value = ""
- Range("B4").value = ""
- Range("B5").value = ""
- TPM_ERG.weldtextbox1.value = ""
- TPM_ERG.weldtextbox2.value = ""
- TPM_ERG.weldtextbox3.value = ""
- m_1.value = ""
- m_2.value = ""
- m_3.value = ""
- MsgBox "Data Clear", vbInformation
- ElseIf TPM_ERG.calendartext.value = "72" Then
- Range("C3").value = ""
- Range("C4").value = ""
- Range("C5").value = ""
- TPM_ERG.weldtextbox4.value = ""
- TPM_ERG.weldtextbox5.value = ""
- TPM_ERG.weldtextbox6.value = ""
- m_1.value = ""
- m_2.value = ""
- m_3.value = ""
- MsgBox "Data Clear", vbInformation
- ElseIf TPM_ERG.calendartext.value = "73" Then
- Range("D3").value = ""
- Range("D4").value = ""
- Range("D5").value = ""
- TPM_ERG.weldtextbox7.value = ""
- TPM_ERG.weldtextbox8.value = ""
- TPM_ERG.weldtextbox9.value = ""
- m_1.value = ""
- m_2.value = ""
- m_3.value = ""
- MsgBox "Data Clear", vbInformation
- ElseIf TPM_ERG.calendartext.value = "74" Then
- Range("E3").value = ""
- Range("E4").value = ""
- Range("E5").value = ""
- TPM_ERG.weldtextbox10.value = ""
- TPM_ERG.weldtextbox11.value = ""
- TPM_ERG.weldtextbox12.value = ""
- m_1.value = ""
- m_2.value = ""
- m_3.value = ""
- MsgBox "Data Clear", vbInformation
- ElseIf TPM_ERG.calendartext.value = "75" Then
- Range("F3").value = ""
- Range("F4").value = ""
- Range("F5").value = ""
- TPM_ERG.weldtextbox13.value = ""
- TPM_ERG.weldtextbox14.value = ""
- TPM_ERG.weldtextbox15.value = ""
- m_1.value = ""
- m_2.value = ""
- m_3.value = ""
- MsgBox "Data Clear", vbInformation
- ElseIf TPM_ERG.calendartext.value = "76" Then
- Range("G3").value = ""
- Range("G4").value = ""
- Range("G5").value = ""
- TPM_ERG.weldtextbox16.value = ""
- TPM_ERG.weldtextbox17.value = ""
- TPM_ERG.weldtextbox18.value = ""
- m_1.value = ""
- m_2.value = ""
- m_3.value = ""
- MsgBox "Data Clear", vbInformation
- ElseIf TPM_ERG.calendartext.value = "77" Then
- Range("H3").value = ""
- Range("H4").value = ""
- Range("H5").value = ""
- TPM_ERG.weldtextbox19.value = ""
- TPM_ERG.weldtextbox20.value = ""
- TPM_ERG.weldtextbox21.value = ""
- m_1.value = ""
- m_2.value = ""
- m_3.value = ""
- MsgBox "Data Clear", vbInformation
- ElseIf TPM_ERG.calendartext.value = "788" Then
- Range("I3").value = ""
- Range("I4").value = ""
- Range("I5").value = ""
- TPM_ERG.weldtextbox22.value = ""
- TPM_ERG.weldtextbox23.value = ""
- TPM_ERG.weldtextbox24.value = ""
- m_1.value = ""
- m_2.value = ""
- m_3.value = ""
- MsgBox "Data Clear", vbInformation
- End If
- End Sub
- Private Sub m_1_Enter()
- m_1.value = " "
- ThisWorkbook.Sheets("Sheet1").Activate
- Range("A1").Select
- frmCalendar.Show_Cal
- End Sub
- Private Sub m_btn_finish_Click()
- If m_1.value <> "" Then
- m_3.value = Format(Now, "dd mmmm yyyy")
- Else
- MsgBox "Plan Is Empty ", vbInformation
- End If
- End Sub
- Private Sub m_btn_start_Click()
- If m_1.value <> "" Then
- m_2.value = Format(Now, "dd mmmm yyyy")
- Else
- MsgBox "Plan Is Empty ", vbInformation
- End If
- If m_1.value < m_2.value Then
- m_2.ForeColor = RGB(138, 132, 18) 'yellow
- ElseIf m_1.value > m_2.value Then
- m_2.ForeColor = RGB(153, 18, 18) 'red
- ElseIf m_1.value = m_2.value Then 'green
- m_2.ForeColor = RGB(10, 92, 22)
- End If
- End Sub
- Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
- m_1.value = ""
- m_2.value = ""
- m_3.value = ""
- mach_EE.value = ""
- ThisWorkbook.Sheets("MAINTENANCE SKILL").Activate
- If Range("B21").value = "99,1%" Then
- Range("B21").value = "100%"
- ElseIf Range("C21").value = "99,1%" Then
- Range("C21").value = "100%"
- ElseIf Range("D21").value = "99,1%" Then
- Range("D21").value = "100%"
- ElseIf Range("E21").value = "99,1%" Then
- Range("E21").value = "100%"
- ElseIf Range("F21").value = "99,1%" Then
- Range("F21").value = "100%"
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement