t'as raison avec le code complet c plus simple, le voici le voila:
Option Explicit
Dim DerLigne As Integer
Dim PlageList As String
Private Sub ComboBox1_Change()
End Sub
Private Sub ComboBox2_Change()
End Sub
Private Sub Label3_Click()
End Sub
Private Sub Label6_Click()
End Sub
Private Sub Label7_Click()
End Sub
Private Sub Label8_Click()
End Sub
Private Sub ListBox2_Click()
End Sub
Private Sub TextBox1_Change()
End Sub
Private Sub TextBox7_Change()
End Sub
Private Sub TextBox2_Change()
End Sub
Private Sub TextBox4_Change()
End Sub
Private Sub TextBox5_Change()
End Sub
Private Sub TextBox6_Change()
End Sub
'SYLVAIN SUIVI NLP January 2003
Private Sub UserForm_Initialize()
DerLigne = Sheets(2).Range("A65536").End(xlUp).Row
PlageList = Sheets(2).Range("A2:A" & DerLigne).Address
ComboBox2.RowSource = "BASE!" & PlageList
ComboBox2.ColumnWidths = "2 cm"
DerLigne = Sheets(2).Range("A65536").End(xlUp).Row
PlageList = Sheets(2).Range("E2:E" & DerLigne).Address
ComboBox1.RowSource = "BASE!" & PlageList
ComboBox1.ColumnWidths = "2 cm"
TextBox4.Value = Format(Now, "DD/MM/YYYY")
TextBox2 = Sheets("Base").Range("C2")
CommandButton1.Visible = False
End Sub
Private Sub ComboBox2_Click()
Dim Plage As Range
Dim Cell As Range
Set Plage = Sheets(2).Range("A1:A" & DerLigne)
For Each Cell In Plage
If Cell.Value = ComboBox2.Value Then
TextBox1 = Cell.Offset(0, 1).Value
TextBox2 = Cell.Offset(0, 2).Value
TextBox3 = Cell.Offset(0, 3).Value
TextBox5 = Cell.Offset(0, 5).Value
End If
Next Cell
CommandButton1.Visible = True
End Sub
Private Sub CommandButton1_click()
'test si un texte a été entré, si non, le programme averti
If frmslyv.TextBox6.Text = "" Then
MsgBox "Vous avez oubliez une cellule"
TextBox6.SetFocus
' ElseIf frmslyv.ComboBox1.Text = "" Then
'MsgBox "Vous avez oubliez une cellule"
End If
With Sheets(1)
.Range("D8") = ComboBox2
.Range("E8") = TextBox1
.Range("A8") = TextBox2
.Range("B8") = TextBox3
.Range("C8") = TextBox4
.Range("G8") = TextBox5
.Range("F8") = TextBox6
.Range("H8") = ComboBox1
End With
Unload frmslyv
End Sub
Private Sub CommandButton2_Click()
Sheets(1).Range("B3,G3,G5,G6,B7,B13,B16").ClearContents
Unload frmslyv
End Sub
A+ Sylvain...