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
|
'********************************************************************************
'****************** VALIDATION ASSEMBLAGE****************************************
'********************************************************************************
Private Sub SUITE_ASSEMBLAGE_Click()
On Error Resume Next
'*** TESTER CONDITION ***********************
If TestCondIND(Len(BOX_REFERENCE2.Value)) = False Then GoTo FinProgA
If TestCondSTEP(Len(BOX_PRODUCTION.Value)) = False Then GoTo FinProgB
If TestCondOF(Len(BOX_OF.Value)) = False Then GoTo FinProgC
If TestCondSN(Len(BOX_SN.Value)) = False Then GoTo FinProgD
If TestCondNOM(Len(BOX_NOM.Value)) = False Then GoTo FinProgE
Dim VarA As String, VarCpt As Integer
'****************** Incrémentation ETAPE DE PRODUCTION ***************************
Dim maVariable0 As String
maVariable0 = BOX_PRODUCTION
'****************** Incrémentation Date ******************************************
Date = Now()
Dim maVariable1 As String, MyStr
maVariable1 = Date
MyStr = Format(Date, ("MM/DD/YYYY"))
'****************** Incrémentation OF ********************************************
Dim maVariable2 As String
maVariable2 = BOX_OF
'****************** Incrémentation SN ********************************************
Dim maVariable3 As String
maVariable3 = BOX_SN
'****************** Incrémentation TYPOLOGIE *************************************
Dim maVariable4 As String
maVariable4 = BOX_TYPOLOGIE
If Range("i2") = "" Then Range("I2").Value = maVariable4
If Range("i2") <> "" Then Range("I2") = Range(I2).Value
'****************** Incrémentation ENSEMBLE **************************************
Dim maVariable5 As String
maVariable5 = BOX_ENSEMBLE
If Range("i3") = "" Then Range("I3").Value = maVariable5
If Range("i3") <> "" Then Range("I3") = Range(I3).Value
'****************** Incrémentation REFERENCE **************************************
Dim maVariable6 As String
maVariable6 = BOX_REFERENCE
If Range("A2") = "" Then Range("A2").Value = maVariable6
If Range("A2") <> "" Then Range("A2") = Range(A2).Value
'****************** Incrémentation Indice ENSEMBLE *******************************
Dim maVariable7 As String
maVariable7 = BOX_REFERENCE2
'****************** Nom de l'utilsateur ******************************************
Dim maVariable8 As String
maVariable8 = Application.UserName
Range("I5").Value = maVariable8
'****************** COMPTEUR *****************************************************
Range("A1").Select
VarCpt = Range("A1").Value + 4
ActiveCell(VarCpt, 1).Select
ActiveCell.Offset(0, 0).Value = maVariable0
ActiveCell.Offset(0, 1).Value = maVariable1
ActiveCell.Offset(0, 2).Value = maVariable2
ActiveCell.Offset(0, 3).Value = maVariable3
ActiveCell.Offset(0, 4).Value = maVariable7
'userform suivant ********************************
Unload Me
VARIABLE_ASSEMBLAGE.Show
FinProgA:
'*** MESAGE BOX ERREUR DE SAISIE IND ***********************
MsgBox "Renseigner l'indice de la référence suivant ce format (XX) avec X = une lettre .", vbCritical, "BOITE D'AVERTISSEMENT"
GoTo FinProgter
FinProgB:
'*** MESAGE BOX ERREUR DE SAISIE STEP ***********************
MsgBox "Renseigner le domaine d'application (drapage, usinage ou assemblage) .", vbCritical, "BOITE D'AVERTISSEMENT"
GoTo FinProgter
FinProgC:
'*** MESAGE BOX ERREUR DE SAISIE OF ***********************
MsgBox "Renseigner le numéro d'OF suivant le format XXXXXX .", vbCritical, "BOITE D'AVERTISSEMENT"
GoTo FinProgter
FinProgD:
'*** MESAGE BOX ERREUR DE SAISIE SN ***********************
MsgBox "Renseigner le numéro d'OF suivant le format XXXXXX (1 à 6 chiffres possible) .", vbCritical, "BOITE D'AVERTISSEMENT"
GoTo FinProgter
FinProgE:
'*** MESAGE BOX ERREUR DE SAISIE SN ***********************
MsgBox "Renseigner votre nom. .", vbCritical, "BOITE D'AVERTISSEMENT"
GoTo FinProgter
FinProgter:
End Sub |
Partager