Erreur 9 l'indice n'appartient pas à la sélection

bonjour,

j'ai un problème avec ce code:

Private Sub Enregistrer_Click()

End Sub

Private Sub CommandButton1_Click()

If Me.Description = "" Or Me.Catégorie.ListIndex < 0 Or Me.Subcat.ListIndex < 0 Or Me.txdate = "" Or Me.somme = "" Or Me.compte.ListIndex < 0 Or Me. créancier = "" Then

MsgBox "il manques des informations"

Else

'controler si la base de donnée est vide oui ou non

If Sheets("input").Range(“b3”) <> “” Then <============= le débogage vient de là apparemment

Sheets(“input”).ListObjects(1).ListRows.Add

End If

End If

End Sub

Pouvez- m'aider?merci d'avance!

Salut mcdulbecco et

à tester

Private Sub CommandButton1_Click()
If Me.Description = "" Or Me.Catégorie.ListIndex < 0 Or Me.Subcat.ListIndex < 0 Or Me.txdate = "" Or Me.somme = "" Or Me.compte.ListIndex < 0 Or Me.créancier = "" Then
MsgBox "il manques des informations"

Else

'controler si la base de donnée est vide oui ou non

If Sheets("input").Range("B3") <> "" Then
Sheets("input").ListObjects(1).ListRows.Add

End If

End If

End Sub

@++

Bonjour,

toujours la même erreur....

peut on voir le fichier?

15compta-essai1.xlsm (90.66 Ko)

voici le fichier

essaie comme ca

Private Sub CommandButton1_Click()
If Me.Description = "" Or Me.Catégorie.ListIndex < 0 Or Me.Subcat.ListIndex < 0 Or Me.txdate = "" Or Me.somme = "" Or Me.compte.ListIndex < 0 Or Me.créancier = "" Then
MsgBox "il manques des informations"

Else

'controler si la base de donnée est vide oui ou non

If Sheets("input ").Range("B3") <> "" Then
Sheets("input ").ListObjects(1).ListRows.Add

End If

End If

End Sub

Ah super ça fonctionne!!! merci beaucoup! cela faisait 4h que je cherchais! ou etait l'erreur?

l'erreur c'est un espace dans le nom de la feuille "input "

merci mille fois!!! je ne savais pas qu'il fallait un espace!

de rien

Rechercher des sujets similaires à "erreur indice appartient pas selection"