Erreur 1004

Bonjour,

Je n'arrive pas à trouver l'erreur dans le code ci dessous qui me renvoie le message :

" erreur 1004 : erreur définie par l'application ou par l'objet "

Merci d'avance.

Sub boucle()

Dim note(3, 3) As Integer
Dim i, j As Integer
Dim s As Integer

For j = 0 To 2
    For i = 0 To 2
    Sheets("Feuil2").Range(Cells(j + 1, i + 1)).Value = note(j, i)
    Next i
Next j

j = 0
s = CInt(InputBox("Condition"))
While s = 1

    For i = 0 To 2

    If note(j, i) = 0 Then
    note(j, i) = CInt(InputBox("Données"))
    Sheets("Feuil2").Range(Cells(j + 1, i + 1)).Value = note(j, i)
    End If

    Next i

j = j + 1
s = CInt(InputBox("Condition"))
Wend

MsgBox note(0, 0)
MsgBox note(0, 1)
MsgBox note(0, 2)
MsgBox note(1, 0)
MsgBox note(1, 1)
MsgBox note(1, 2)
MsgBox note(2, 0)
MsgBox note(2, 1)
MsgBox note(2, 2)

End Sub

Bonsoir,

essaie ceci

j'ai supprimé tes range().

Sub boucle()

Dim note(3, 3) As Integer
Dim i, j As Integer
Dim s As Integer

For j = 0 To 2
    For i = 0 To 2
    Sheets("Feuil2").Cells(j + 1, i + 1).Value = note(j, i)
    Next i
Next j

j = 0
s = CInt(InputBox("Condition"))
While s = 1

    For i = 0 To 2

    If note(j, i) = 0 Then
    note(j, i) = CInt(InputBox("Données"))
    Sheets("Feuil2").Cells(j + 1, i + 1).Value = note(j, i)
    End If

    Next i

j = j + 1
s = CInt(InputBox("Condition"))
Wend

MsgBox note(0, 0)
MsgBox note(0, 1)
MsgBox note(0, 2)
MsgBox note(1, 0)
MsgBox note(1, 1)
MsgBox note(1, 2)
MsgBox note(2, 0)
MsgBox note(2, 1)
MsgBox note(2, 2)

End Sub
Rechercher des sujets similaires à "erreur 1004"