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 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
| Private Sub CommandButton2_Click()
'message de confimation
If MsgBox("confirmez-vous la création de cette nouvelle joblist?", vbYesNo, "Demande de confirmation d'ajout") = vbYes Then
'mise à jour de la base de données
Sheets("gestion_de_processus").Select
Dim L As Long
'If ComboBox1 = "" Or TextBox2 = "" Or TextBox3 = "" Or TextBox4 = "" Or TextBox5 = "" Then
'If MsgBox("Toutes les informations ne sont pas remplies. Voulez-vous continuer?", vbYesNo, "Message") = vbYes Then
'Else
If Sheets("gestion_de_processus").range("A2") = "" Then
Sheets("gestion_de_processus").range("A2") = ComboBox1.Value
Else
Sheets("gestion_de_processus").ListObjects(1).ListRows.Add
End If
L = Sheets("gestion_de_processus").range("A65536").End(xlUp).Row
range("a" & L) = ComboBox1.Value
range("B" & L) = TextBox2.Value
range("C" & L) = TextBox3.Value
range("D" & L) = TextBox4.Value
range("E" & L) = TextBox5.Value
If ComboBox1.Value Like "*c2071*" Then
range("g" & L).Value = "n/ap"
End If
End If
Dim first_date As Date
Dim second_date As Date
Dim trois_date As Date
'Dim cell As Integer
Dim ws As Worksheet
Set ws = Sheets("Gestion_de_processus")
For cell = 2 To ws.range("g" & Rows.Count).End(xlUp).Row
If Cells(cell, "g").Value = "" Then
first_date = Cells(cell, "d").Value
second_date = DateAdd("d", 5, first_date)
Cells(cell, "g").Value = second_date
trois_date = DateAdd("d", 3, second_date)
Cells(cell, "h").Value = trois_date
End If
Next cell
Dim wb As Workbook
Set wb = Workbooks.Open("C:\Users\ma512977.SBRXSRVS\Downloads\Classeur_Mi.xlsm")
Worksheets("Suivi_analyses").Shapes.AddTextbox(msoTextOrientationHorizontal, 40.25, 40#, _
140.25, 75.75).Select
Selection.Name = "Ma_zone"
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 27
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 0.75
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.ForeColor.SchemeColor = 64
Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)
Selection.Characters.Text = "JOBLIST: " & ComboBox1.Value _
& Chr(10) & "DATE: " & TextBox4.Value _
& Chr(10) & "INITIALE: " & TextBox5.Value _
& Chr(10) & "TRANSFERT: " & ws.range("g" & L).Value _
& Chr(10) & "LECTURE FINALE: " & ws.range("h" & L).Value _
With Selection.Characters(Start:=1, Length:=26).Font
.Name = "Arial"
.FontStyle = "Normal"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Unload Me
End Sub |
Partager