Private Sub ComboBox1_Click()
If ComboBox1.ListIndex = -1 Then Exit Sub
For i = 1 To 1
For j = 2 To UBound(tableau)
If CStr(tableau(j, i)) = ComboBox1 Then ligne = j
Next j
Next i
With Me
For i = 1 To 7
Controls("TextBox" & i) = Cells(ligne, i).Value
Next i
End With
End Sub
Private Sub CommandButton1_Click()
ligne = Range("A" & Range("A:A").Rows.Count).End(xlUp).Row '+ 1
For i = 1 To 7
Cells(ligne, i) = Controls("TextBox" & i).Value
Next i
Beep
End Sub
Private Sub ComboBox1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
'Private Sub cbx1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
'ComboBox1 .SetFocus
'ComboBox1 .DropDown
End Sub
Private Sub CommandButton2_Click()
x = Sheets("SAC").Range("A65536").End(xlUp).Row + 1
For i = 1 To 7
Sheets("SAC").Cells(x, i) = Controls("Textbox" & i).Value
Next i
Unload Me
fatis.Show
Beep
End Sub
Private Sub CommandButton3_Click()
Unload Me
End Sub
Private Sub UserForm_Click()
End Sub
Private Sub UserForm_Initialize()
tableau = Range("A1:A" & Range("A65536").End(xlUp).Row)
For i = 1 To 8
For j = 2 To UBound(tableau)
If tableau(j, i) <> "" Then ComboBox1.AddItem tableau(j, i)
Next j
Next i
For y = 1 To 7
Controls("label" & y).Caption = Sheets("SAC").Range("A1:H8").Cells(1, y) & " ==>"
Next y
Label8.Caption = " TOTAL LIGNE INSERÉE(AJOUT_SIMPLE)=" & Application.WorksheetFunction.CountA(Range("A:A")) - 1
End Sub