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
| Sub produit() 'bouton VALIDER
Sheets("interface").Select
Range("F25:G25").Copy
Sheets("PLANFAB").Select
If ActiveCell.Column = 3 Or ActiveCell.Column = 9 Then
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
End If
For l = 4 To 58
If Cells(l, 3).Value <> "" Then
j = l - 1
While j >= 4 And Cells(j, 3).Value <> Cells(l, 3).Value
j = j - 1
Wend
If j = 3 Then
Cells(l, 5).Value = 1
Cells(l, 6).Value = Cells(1, 14).Value & Cells(1, 6).Value & " 2001"
Else
Cells(l, 5).Value = Cells(j, 5).Value + 1
If Cells(l, 5).Value <= 9 Then
Cells(l, 6).Value = Cells(1, 14).Value & Cells(1, 6).Value & " 200" & Cells(l, 5).Value
Else: Cells(l, 6).Value = Cells(1, 14).Value & Cells(1, 6).Value & " 20" & Cells(l, 5).Value
End If
End If
End If
Next
For l = 4 To 58
If Cells(l, 9).Value <> "" Then
j = l - 1
While j >= 4 And Cells(j, 9).Value <> Cells(l, 9).Value
j = j - 1
Wend
If j = 3 Then
Cells(l, 11).Value = 1
Cells(l, 12).Value = Cells(1, 14).Value & Cells(1, 6).Value & " 3001"
Else
Cells(l, 11).Value = Cells(j, 11).Value + 1
If Cells(l, 11).Value <= 9 Then
Cells(l, 12).Value = Cells(1, 14).Value & Cells(1, 6).Value & " 300" & Cells(l, 11).Value
Else: Cells(l, 12).Value = Cells(1, 14).Value & Cells(1, 6).Value & " 30" & Cells(l, 11).Value
End If
End If
End If
Next
End Sub
Sub verification()
Dim ValPrec As Integer, ValSaisie As Integer
Chrono = ";MF 135 U;MM 71135 U;MM 31762/40;MF 345 U;MM 71791/40;MM 71791/50;MPA 1;PA 71155;MF 50 U;MM 71150 U;MF 160 U;MM RH 71160 U;MM 71160 U;MM 71718/60;MF 360 U;MM 71791/60;MF 370 U;MM 71791/70;MF 175 U;MF 180 U;MF 135 1U;MF 31787;MM 1732 P45;MF 40 U;MF 8150 U;MF 60 U;MF 8160 U;MF 8160 USP;MF 8360 U;MF 8170 U;MF 8370 U;MF 940 U;"
ValPréc = Cells(ActiveCell.Row - 1, 3).Value
ValSaisie = Cells(ActiveCell.Row, 3).Value
ValPréc = Range("C" & ActiveCell.Row - 1).Value
ValSaisie = Range("C" & ActiveCell.Row).Value
CompareVals = ";" & ValPréc & ";" & ValSaisie & ";"
If Chrono Like "*" & CompreVals & "*" Then MsgBox "C'est ok"
Sub retour()
Sheets("PLANFAB").Select
End Sub |