Problème dans le code VBA
Bonjours,
Alors je suis étudiante en stage, mon patron me demande réglé un problème dans un fichier macro Excel. Après 2mois de recherches, je n'arrive pas à réglé le problème. Pouvez-vous m'aider s'il vous plaît ?
voici le code:
'Pour le bouton Nouvelle action
Private Sub CommandButton1_Click()
Dim L As Integer
If MsgBox("Confirmez-vous l'insertion de cette nouvelle action ?", vbYesNo, "Demande de confirmation d'ajout") = vbYes Then
With Sheets("Feuille1")
L = .Cells(Rows.Count, 1).End(xlUp).Row + 1
.Range("A").Value = ComboBox1.Value
.Range("B").Value = ComboBox3.Value
.Range("C").Value = TextBox1
.Range("D").Value = TextBox30
.Range("E").Value = TextBox25
.Range("F").Value = TextBox2
.Range("G").Value = TextBox3
.Range("H").Value = TextBox4
.Range("I").Value = TextBox5
.Range("J").Value = TextBox34
.Range("K").Value = TextBox9
.Range("L").Value = TextBox10
.Range("M").Value = TextBox11
.Range("N").Value = TextBox31
.Range("O").Value = TextBox33
.Range("P").Value = TextBox32
.Range("Q").Value = ComboBox4.Value
If IsNumeric(TextBox23) Then
.Range("R").Value = CDbl(TextBox23)
Else
.Range("R").Value = TextBox23
End If
If IsNumeric(TextBox15) Then
.Range("S").Value = CDbl(TextBox15)
Else
.Range("S").Value = TextBox23
End If
.Range("T").Value = TextBox24 --> cette ligne me pose problème, elle affiche faux à chaque fois
.Range("U").Value = ComboBox6.Value
.Range("V").Value = TextBox12
.Range("W").Value = TextBox13
If IsNumeric(TextBox27) Then
.Range("X").Value = CDbl(TextBox27)
Else
.Range("X").Value = TextBox27
End If
.Range("Y").Value = ComboBox13.Value
If IsNumeric(TextBox28) Then
.Range("Z").Value = CDbl(TextBox28)
Else
.Range("Z").Value = TextBox28
End If
.Range("AA").Value = ComboBox14.Value
If IsNumeric(TextBox29) Then
.Range("R" & L).Value = CDbl(TextBox29)
Else
.Range("R" & L).Value = TextBox29
End If
.Range("AC").Value = ComboBox15.Value
If IsNumeric(TextBox8) Then
.Range("R" & L).Value = CDbl(TextBox8)
Else
.Range("R" & L).Value = TextBox8
End If
.Range("AE").Value = TextBox26
.Range("AF").Value = ComboBox9.Value
.Range("AG").Value = ComboBox7.Value
.Range("AH").Value = ComboBox8.Value
.Range("AI").Value = ComboBox10.Value
If IsNumeric(TextBox16) Then
.Range("R" & L).Value = CDbl(TextBox16)
Else
.Range("R" & L).Value = TextBox16
End If
If IsNumeric(TextBox17) Then
.Range("R" & L).Value = CDbl(TextBox17)
Else
.Range("R" & L).Value = TextBox17
End If
If IsNumeric(TextBox18) Then
.Range("R" & L).Value = CDbl(TextBox18)
Else
.Range("R" & L).Value = TextBox18
End If
.Range("AM").Value = TextBox14
.Range("AN").Value = TextBox19
.Range("AO").Value = TextBox20
End With
End Sub
Bonjour,
Le mot problème s'accompagne d'une description de ce dernier. Tu peux également utiliser les balises <> pour mettre en forme ton code, voir dans le meilleur des monde, nous joindre un fichier avec données anonymisées.
En l'état, peu de chances que tu reçoives de l'aide .. Nous mettrions nous aussi peut être 2 mois à rechercher le problème.
PS : J'espère que ton patron ne t'as pas fait la même description, sinon je comprend ton désarroi ..
Bonne soirée.
voici un fichier du code
Bonjour,
Tu peux dire à ton patron que c'est ce qui arrive quand on confie le développement à des stagiaires.
Ceci dit, en mettant un point d'arrêt dans le code sur la ligne qui pose problème, tu peux voir le contenu des variables et objets incriminés
PS: le code on le voit, c'est le fichier Excel qu'il faut