H
Hélène
Guest
Bonsoir le forum
J'ai une macro qui permet de remplir une feuille via un usf
A chaque oubli :textbox3 option button1(cds) option button2(dvds) optionbutton3(dvdgraves)
combobox1 et combobox5 il y a un message qui doit apparaitre
Les autres textbox ne serevent qu'à récupérer des informations
Tout fonctionne sauf pour les options button 1 2 et 3 soit (cds dvds dvdgraves)
L'erreur se situe entre les signes ====
Voici la macro :
Private Sub CommandButton2_Click()
If UserForm2.TextBox3 = '' Then
MsgBox 'Veuillez saisir la date', vbInformation, 'DVDTHEQUE'
UserForm2.TextBox3.SetFocus
Exit Sub
End If
===============================================
If UserForm2.CDS = False Or UserForm2.DVDS = False Or UserForm2.dvdgraves = False Then
MsgBox 'Veuillez sélectionner cd, dvd ou dvd grave', vbInformation, 'DVDTHEQUE'
UserForm2.CDS.SetFocus
UserForm2.DVDS.SetFocus
UserForm2.dvdgraves.SetFocus
Exit Sub
End If
===============================================
If UserForm2.ComboBox1.ListIndex = -1 Then
MsgBox 'Veuillez sélectionner le titre du film', vbInformation, 'DVDTHEQUE'
UserForm2.ComboBox1.SetFocus
Exit Sub
End If
If UserForm2.ComboBox5.ListIndex = -1 Then
MsgBox 'Veuillez sélectionner l'emprunteur', vbInformation, 'DVDTHEQUE'
UserForm2.ComboBox5.SetFocus
Exit Sub
End If
Sheets('PRET').Range('C65536').End(xlUp).Offset(1, 0).Value = ComboBox1.Value
Sheets('PRET').Range('D65536').End(xlUp).Offset(1, 0).Value = TextBox4.Value
Sheets('PRET').Range('E65536').End(xlUp).Offset(1, 0).Value = TextBox5.Value
Sheets('PRET').Range('F65536').End(xlUp).Offset(1, 0).Value = TextBox6.Value
Sheets('PRET').Range('G65536').End(xlUp).Offset(1, 0).Value = TextBox3.Value
Sheets('PRET').Range('H65536').End(xlUp).Offset(1, 0).Value = ComboBox5.Value
ComboBox1 = ''
TextBox4 = ''
TextBox5 = ''
TextBox6 = ''
TextBox3 = ''
ComboBox5 = ''
End Sub
Si quelqu'un pouvait m'aider à résoudre ce problème ce serait sympa de sa part
Bonne soirée
Hélène
J'ai une macro qui permet de remplir une feuille via un usf
A chaque oubli :textbox3 option button1(cds) option button2(dvds) optionbutton3(dvdgraves)
combobox1 et combobox5 il y a un message qui doit apparaitre
Les autres textbox ne serevent qu'à récupérer des informations
Tout fonctionne sauf pour les options button 1 2 et 3 soit (cds dvds dvdgraves)
L'erreur se situe entre les signes ====
Voici la macro :
Private Sub CommandButton2_Click()
If UserForm2.TextBox3 = '' Then
MsgBox 'Veuillez saisir la date', vbInformation, 'DVDTHEQUE'
UserForm2.TextBox3.SetFocus
Exit Sub
End If
===============================================
If UserForm2.CDS = False Or UserForm2.DVDS = False Or UserForm2.dvdgraves = False Then
MsgBox 'Veuillez sélectionner cd, dvd ou dvd grave', vbInformation, 'DVDTHEQUE'
UserForm2.CDS.SetFocus
UserForm2.DVDS.SetFocus
UserForm2.dvdgraves.SetFocus
Exit Sub
End If
===============================================
If UserForm2.ComboBox1.ListIndex = -1 Then
MsgBox 'Veuillez sélectionner le titre du film', vbInformation, 'DVDTHEQUE'
UserForm2.ComboBox1.SetFocus
Exit Sub
End If
If UserForm2.ComboBox5.ListIndex = -1 Then
MsgBox 'Veuillez sélectionner l'emprunteur', vbInformation, 'DVDTHEQUE'
UserForm2.ComboBox5.SetFocus
Exit Sub
End If
Sheets('PRET').Range('C65536').End(xlUp).Offset(1, 0).Value = ComboBox1.Value
Sheets('PRET').Range('D65536').End(xlUp).Offset(1, 0).Value = TextBox4.Value
Sheets('PRET').Range('E65536').End(xlUp).Offset(1, 0).Value = TextBox5.Value
Sheets('PRET').Range('F65536').End(xlUp).Offset(1, 0).Value = TextBox6.Value
Sheets('PRET').Range('G65536').End(xlUp).Offset(1, 0).Value = TextBox3.Value
Sheets('PRET').Range('H65536').End(xlUp).Offset(1, 0).Value = ComboBox5.Value
ComboBox1 = ''
TextBox4 = ''
TextBox5 = ''
TextBox6 = ''
TextBox3 = ''
ComboBox5 = ''
End Sub
Si quelqu'un pouvait m'aider à résoudre ce problème ce serait sympa de sa part
Bonne soirée
Hélène