Private Sub CommandButton1_Click()
Dim derligne As Integer
If MsgBox("Confirmez-vous l'Ajout des Données ?", vbYesNo, "confirmation") = vbYes Then
derligne = Sheets("Saisie").Range("A254256").End(xlUp).Row + 1
Cells(derligne, 1) = ComboBox1.Value
Cells(derligne, 3) = TextBox1.Value
Cells(derligne, 4) = ComboBox3.Value
Cells(derligne, 5) = TextBox2.Value
Cells(derligne, 6) = ComboBox4.Value
Cells(derligne, 7) = TextBox3.Value
Cells(derligne, 8) = ComboBox5.Value
Cells(derligne, 9) = TextBox4.Value
Cells(derligne, 10) = ComboBox6.Value
Cells(derligne, 11) = TextBox5.Value
Cells(derligne, 12) = ComboBox7.Value
Cells(derligne, 13) = TextBox6.Value
Cells(derligne, 14) = ComboBox8.Value
Cells(derligne, 15) = TextBox7.Value
Cells(derligne, 16) = ComboBox9.Value
Cells(derligne, 17) = TextBox15.Value
Cells(derligne, 18) = ComboBox10.Value
Cells(derligne, 19) = TextBox9.Value
Cells(derligne, 20) = ComboBox11.Value
Cells(derligne, 21) = TextBox10.Value
Cells(derligne, 22) = ComboBox12.Value
Cells(derligne, 23) = TextBox11.Value
Cells(derligne, 24) = ComboBox13.Value
Cells(derligne, 25) = TextBox12.Value
Cells(derligne, 26) = ComboBox14.Value
Cells(derligne, 27) = TextBox13.Value
End If
Unload Me
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
Private Sub Frame1_Click()
End Sub
Private Sub OptionButton1_Click()
Dim oOutlook As Object
Set oOutlook = CreateObject("Outlook.Application")
Dim oMail As Object
Set oMail = oOutlook.CreateItem(0)
With oMail
Dim oObjetWord As Object
Set oObjetWord = .GetInspector.WordEditor
Application.EnableEvents = Fals
.To = "coucou@coucou.com"
.Subject = "Mail automatique : " & ThisWorkbook.Name
Range("AB10:AM23").Select
Range("AB10:AM23").Copy
oObjetWord.Range(0).Paste
'.Send
.Display
.Save
.Send
Application.CutCopyMode = False
Range("A2").Select
ActiveWindow.ScrollRow = Selection.Row
ActiveWindow.ScrollColumn = Selection.Column
Application.EnableEvents = True
End With
End Sub
Private Sub TextBox14_Change()
End Sub
Private Sub TextBox2_Change()
End Sub
Private Sub TextBox3_Change()
End Sub
Private Sub UserForm_Initialize()
TextBox1.Value = Format(Now, "dd/mm/yyyy")
End Sub
Private Sub ComboBox1_Change()
With ThisWorkbook.Sheets("Saisie")
For Each Nom In .Range("A3:A1000" & .[A65000].End(xlUp).Row)
If CStr(Nom) = CStr(Me.ComboBox1.Value) Then
Me.TextBox2.Value = .Cells(Nom.Row, 5)
Me.TextBox3.Value = .Cells(Nom.Row, 7)
Me.TextBox4.Value = .Cells(Nom.Row, 9)
Me.TextBox5.Value = .Cells(Nom.Row, 11)
Me.TextBox6.Value = .Cells(Nom.Row, 13)
Me.TextBox7.Value = .Cells(Nom.Row, 15)
Me.TextBox15.Value = .Cells(Nom.Row, 17)
Me.TextBox9.Value = .Cells(Nom.Row, 19)
Me.TextBox10.Value = .Cells(Nom.Row, 21)
Me.TextBox11.Value = .Cells(Nom.Row, 23)
Me.TextBox12.Value = .Cells(Nom.Row, 25)
Me.TextBox13.Value = .Cells(Nom.Row, 27)
Me.TextBox14.Value = .Cells(Nom.Row, 29)
Me.ComboBox3.Value = .Cells(Nom.Row, 4)
Me.ComboBox4.Value = .Cells(Nom.Row, 6)
Me.ComboBox5.Value = .Cells(Nom.Row, 8)
Me.ComboBox6.Value = .Cells(Nom.Row, 10)
Me.ComboBox7.Value = .Cells(Nom.Row, 12)
Me.ComboBox8.Value = .Cells(Nom.Row, 14)
Me.ComboBox9.Value = .Cells(Nom.Row, 16)
Me.ComboBox10.Value = .Cells(Nom.Row, 18)
Me.ComboBox11.Value = .Cells(Nom.Row, 20)
Me.ComboBox12.Value = .Cells(Nom.Row, 22)
Me.ComboBox13.Value = .Cells(Nom.Row, 24)
Me.ComboBox14.Value = .Cells(Nom.Row, 26)
End If
Next
End With
End Sub