emma13
Habitué
salut !!
alors j'ai fait un petit programme, mais il ne me fait pas ce que je veux !!
[cpp]Sub calcule()
Dim i, j As Integer
For i = 7 To 24
For j = 6 To 23
if Cells(i, j).Offset(-1, 0).Interior.ColorIndex = 2 And Cells(i,
j).Offset(-1, 1).Interior.ColorIndex = 2 And Cells(i, j).Offset(0,
1).Interior.ColorIndex = 2 And Cells(i, j).Offset(1, 1).interior.ColorIndex = 2
And Cells(i, j).Offset(1, 0).Interior.ColorIndex = 2 And Cells(i,
j).Offset(1, -1).Interior.ColorIndex = 2 And Cells(i, j).Offset(0,
-1).Interior.ColorIndex = 2 And Cells(i, j).Offset(-1, -1).Interior.ColorIndex =
2
Cells(i, j).Value = 9
else cells(i,j)=13
endif
Next j
Next i
End Sub
[/cpp]
il ne m'affiche jamais la valeur 9. quoi que je fasse c'est toujours 13.
j'ai beau regardé ce qu'il n'allait pas, mais la je vois pas, ça doit etre un truc tout bete mais qui m'echappe.
Merci de votre aide.
alors j'ai fait un petit programme, mais il ne me fait pas ce que je veux !!
[cpp]Sub calcule()
Dim i, j As Integer
For i = 7 To 24
For j = 6 To 23
if Cells(i, j).Offset(-1, 0).Interior.ColorIndex = 2 And Cells(i,
j).Offset(-1, 1).Interior.ColorIndex = 2 And Cells(i, j).Offset(0,
1).Interior.ColorIndex = 2 And Cells(i, j).Offset(1, 1).interior.ColorIndex = 2
And Cells(i, j).Offset(1, 0).Interior.ColorIndex = 2 And Cells(i,
j).Offset(1, -1).Interior.ColorIndex = 2 And Cells(i, j).Offset(0,
-1).Interior.ColorIndex = 2 And Cells(i, j).Offset(-1, -1).Interior.ColorIndex =
2
Cells(i, j).Value = 9
else cells(i,j)=13
endif
Next j
Next i
End Sub
[/cpp]
il ne m'affiche jamais la valeur 9. quoi que je fasse c'est toujours 13.
j'ai beau regardé ce qu'il n'allait pas, mais la je vois pas, ça doit etre un truc tout bete mais qui m'echappe.
Merci de votre aide.