Bonsoir,
J'utilise un userform pour entrer des données dans un tableau et, bizzarement à intervalle irrégulier (1 fois sur 3 ou 4 entrées) j'ai ce bug qui apparait
et du coup ca ne prend pas en compte mon ajout de données, a ce moment il note juste ma date-entree et il plante sur cette ligne.
Quelqu'un a t il déjà rencontré ce problème ?
Merci beaucoup pour votre aide
Eric
Private Sub CommandButton1_Click()
Dim date_entree As Date
If Me.TextBox1.Value <> "" Then
date_entree = Format(Me.TextBox1.Value, "dd/mm/yyyy")
End If
Dim date_sortie As Date
If Me.TextBox6.Value <> "" Then
date_sortie = Format(Me.TextBox6.Value, "dd/mm/yyyy")
End If
Dim derligne As Integer
'Ne pas voir la macro s'exécuter
Application.ScreenUpdating = False
Call ToutDeproteger
'Ajouter un nouvel article
Sheets("Saisie").Select
    If MsgBox("Confirmer la saisie", vbYesNo, "confirmation") = vbYes Then
    
    derligne = Sheets("saisie").Range("f1048576").End(xlUp).Row + 1
    
    Cells(derligne, 4) = date_entree     'VOILA LA CAUSE DU BUG
    Cells(derligne, 5) = date_sortie
    Cells(derligne, 6) = ComboBox1.Value
    Cells(derligne, 7) = ComboBox2.Value
    Cells(derligne, 8) = ComboBox3.Value
    Cells(derligne, 9) = TextBox2.Value
    Cells(derligne, 10) = TextBox3.Value
    Cells(derligne, 11) = TextBox4.Value
    Cells(derligne, 12) = TextBox5.Value
    Cells(derligne, 16) = TextBox7.Value
End If
On Error GoTo Defaut
    
Photo = ComboBox4.Value
Image1.Picture = LoadPicture("C:\JCR\Photos Bijoux\" & Photo & ".Jpg")
Exit Sub
Defaut:
'Image1.Picture = LoadPicture("C:\JCR\Photos Bijoux\Defaut.Jpg")
'Rafraichir le tableau croisé dynamique
Columns("D😀").Select
    
    Selection.NumberFormat = "m/d/yyyy"
Sheets("Stock Par Produit").Select
    ActiveWorkbook.RefreshAll
    Sheets("SAISIE").Select
    
    Call ToutProteger
    Unload FormulaireSaisie
    'FormulaireSaisie.Show
    ActiveWorkbook.Save
    Application.ScreenUpdating = True
End Sub