Ilino
XLDnaute Barbatruc
Bonjour Forum
dans mon USF de saisie, j'ai un bouton (nommé Ajouter) ce dernier son role de remplir un tableau via les TextBox et ComboBox
	
	
	
	
	
		
 et comme dans mon USF de saisie j'ai d'autre TextBox et ComboBox , je souhaite limiter ce code aux TextBOX et combobox qui sont defini dans ce code seulement ?
je sais que a ce niveau la ( si je me trompe pas)
	
	
	
	
	
		
que je dois changer mais j'ai pas pu le faire 
GRAZIE par avance
	
		
			
		
		
	
				
			dans mon USF de saisie, j'ai un bouton (nommé Ajouter) ce dernier son role de remplir un tableau via les TextBox et ComboBox
		Code:
	
	
	Private Sub CommandButton1_Click() ' Bouton Ajouter
Dim c As Control
For Each c In UserForm1.Controls
Select Case TypeName(c)
Case "TextBox", "ComboBox"
If Len(c.Value) = 0 Then
c.Enabled = True
c.BackColor = RGB(255, 0, 0)
MsgBox "Merci de completer les zones manquantes!"
c.SetFocus
Exit Sub
End If
End Select
Next c
MsgBox "Votre saisie est maintenant complète"
Ligne = Sheets("FSEx 2014").Range("a65500").End(xlUp).Row + 1
Sheets("FSEx 2014").Cells(Ligne, 1) = ComboBox1.Value
Sheets("FSEx 2014").Cells(Ligne, 2) = ComboBox6.Value
Sheets("FSEx 2014").Cells(Ligne, 3) = ComboBox2.Value
Sheets("FSEx 2014").Cells(Ligne, 8) = ComboBox3.Value
Sheets("FSEx 2014").Cells(Ligne, 6) = ComboBox4.Value
Sheets("FSEx 2014").Cells(Ligne, 7) = ComboBox5.Value
Sheets("FSEx 2014").Cells(Ligne, 4) = intitulétextbox.Value
Sheets("FSEx 2014").Cells(Ligne, 5) = statuttextbox.Value
Sheets("FSEx 2014").Cells(Ligne, 9) = TextBox1.Value
Sheets("FSEx 2014").Cells(Ligne, 12) = TextBox2.Value
ComboBox6 = ""
ComboBox2 = ""
ComboBox3 = ""
ComboBox4 = ""
ComboBox5 = ""
intitulétextbox = ""
statuttextbox = ""
TextBox1 = ""
TextBox2 = ""
'TextBox3 = ""
UserForm1.ComboBox1.Value = ""
UserForm1.CommandButton1.Visible = False
UserForm1.ComboBox1.RowSource = "A2:A" & [A65000].End(xlUp).Row
Unload UserForm1
End Sub
	je sais que a ce niveau la ( si je me trompe pas)
		Code:
	
	
	For Each c In UserForm1.Controls
Select Case TypeName(c)
Case "TextBox", "ComboBox"
If Len(c.Value) = 0 Then
	GRAZIE par avance
			
				Dernière édition: