Private Sub CommandButton1_Click()
If TextBox2.Value <> "" Then
Worksheets("Noms").Activate
lr = Range("A" & Rows.Count).End(xlUp).Row
Range("A" & lr + 1).Value = TextBox1.Value
Range("A" & lr + 1).Offset(0, 1).Value = TextBox2.Value
Range("A" & lr + 1).Offset(0, 2).Value = TextBox3.Value
Range("A" & lr + 1).Offset(0, 3).Value = TextBox4.Value
Range("A" & lr + 1).Offset(0, 4).Value = TextBox5.Value
Range("A" & lr + 1).Offset(0, 5).Value = TextBox6.Value
Range("A" & lr + 1).Offset(0, 6).Value = TextBox7.Value
TextBox1.Value = ""
TextBox2.Value = ""
TextBox3.Value = ""
TextBox4.Value = ""
TextBox5.Value = ""
TextBox5.Value = ""
TextBox6.Value = ""
TextBox7.Value = ""
Unload Me
Départements.Show
Else
MsgBox (" Vérifier vos informations ")
End If
End Sub
Private Sub CommandButton2_Click()
Worksheets("Noms").Activate
On Error Resume Next
If MsgBox("voulez-vous supprimer les informations suivantes", vbYesNo) = vbYes Then
Rows([B2:B1000].Find(TextBox2.Value).Row).EntireRow.Delete
Unload Me
bopMonastir.Show
End If
End Sub
Private Sub CommandButton3_Click()
Sheets("Noms").Activate
For X = 2 To 2000
If Cells(X, 1) = TextBox1.Text Then
Cells(X, 1).Select
Exit For
End If
Next X
ActiveCell.Offset(0, 1) = TextBox2.Text
ActiveCell.Offset(0, 2) = TextBox3.Text
ActiveCell.Offset(0, 3) = TextBox4.Text
ActiveCell.Offset(0, 4) = TextBox5.Text
ActiveCell.Offset(0, 5) = TextBox6.Text
ActiveCell.Offset(0, 6) = TextBox7.Text
Unload Me
bopMonastir.Show
End Sub
Private Sub CommandButton4_Click()
Unload Me
Application.Visible = True
Worksheets("Noms").Activate
End Sub
Private Sub Image2_BeforeDragOver(ByVal Cancel As MSForms.ReturnBoolean, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal DragState As MSForms.fmDragState, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
End Sub
Private Sub Image3_BeforeDragOver(ByVal Cancel As MSForms.ReturnBoolean, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal DragState As MSForms.fmDragState, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
End Sub
Private Sub Label10_Click()
End Sub
Private Sub Image1_BeforeDragOver(ByVal Cancel As MSForms.ReturnBoolean, ByVal Data As MSForms.DataObject, ByVal X As Single, ByVal Y As Single, ByVal DragState As MSForms.fmDragState, ByVal Effect As MSForms.ReturnEffect, ByVal Shift As Integer)
End Sub
Private Sub Label14_Click()
End Sub
Private Sub Label7_Click()
End Sub
Private Sub Label8_Click()
End Sub
Private Sub Label9_Click()
End Sub
Private Sub ListBox1_Click()
For i = 0 To ListBox1.ListCount
If ListBox1.Selected(i) = True Then
For j = 1 To 7
Controls("TextBox" & j).Text = Cells(ListBox1.List(i, 1), j)
Next j
End If
Next i
End Sub
Private Sub TextBox1_Change()
End Sub
Private Sub TextBox2_Change()
End Sub
Private Sub TextBox27_Change()
ListBox1.Clear
Worksheets("Noms").Activate
For i = 1 To 7
Controls("TextBox" & i).Text = ""
Next i
If TextBox27 = "" Then Exit Sub
ss = Sheets("Noms").Cells(Rows.Count, 2).End(xlUp).Row
k = 0
For Each c In Range("B2:B" & ss)
If c Like TextBox27.Value & "*" Then
ListBox1.AddItem
ListBox1.List(k, 0) = Cells(c.Row, 2).Value
ListBox1.List(k, 1) = c.Row
k = k + 1
End If
Next c
End Sub
Private Sub TextBox3_Change()
End Sub
Private Sub TextBox4_Change()
End Sub
Private Sub TextBox5_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Worksheets("Noms").Activate
TextBox27.Value = ""
ListBox1.Clear
End Sub
Private Sub TextBox6_Change()
End Sub
Private Sub TextBox7_Change()
End Sub
Private Sub UserForm_Activate()
TextBox27.SetFocus
Worksheets("Noms").Activate
For i = 2 To Sheets("Noms").Cells(Rows.Count, 2).End(xlUp).Row
ListBox1.AddItem
ListBox1.List(i - 2, 0) = Cells(i, 2).Value
ListBox1.List(i - 2, 1) = i
Worksheets("Noms").Activate
Next i
End Sub