Bonjour,Bonjour..
un peu léger comme explication de ce que tu veux faire...
un fichier exemple, et un peu plus qu'une ligne de code.. seraient les bienvenus
i= combien?
pourquoi ce test: >3 ??
qui te donnera soit 2 soit 1
Bonjour,Bonjour..
un peu léger comme explication de ce que tu veux faire...
un fichier exemple, et un peu plus qu'une ligne de code.. seraient les bienvenus
i= combien?
pourquoi ce test: >3 ??
qui te donnera soit 2 soit 1
Sub Compte_nombres_t_q_qt()
Application.ScreenUpdating = False
Dim i As Integer
Set WSRecap = Sheets("Recap")
Set WSPron = Sheets("Pronostic")
With WSRecap
For i = 1 To 31
If (Cells(4 + i, 22) > 3) Then .Cells(5 + i, 3) = Cells(4 + i, 22) + 1
If (Cells(4 + i, 22) <> 4) Then .Cells(5 + i, 4) = Cells(4 + i, 22) + 1
If (Cells(4 + i, 22) <> 5) Then .Cells(5 + i, 5) = Cells(4 + i, 22) + 1
If (Cells(4 + i, 22) <> 6) Then .Cells(5 + i, 6) = Cells(4 + i, 22) + 1
If (Cells(4 + i, 22) <> 7) Then .Cells(5 + i, 7) = Cells(4 + i, 22) + 1
If (Cells(4 + i, 22) <> 8) Then .Cells(5 + i, 8) = Cells(4 + i, 22) + 1
If (Cells(4 + i, 23) <> 4) Then .Cells(5 + i, 10) = Cells(4 + i, 23) + 1
If (Cells(4 + i, 23) <> 5) Then .Cells(5 + i, 11) = Cells(4 + i, 23) + 1
If (Cells(4 + i, 23) <> 6) Then .Cells(5 + i, 12) = Cells(4 + i, 23) + 1
If (Cells(4 + i, 23) <> 7) Then .Cells(5 + i, 13) = Cells(4 + i, 23) + 1
If (Cells(4 + i, 23) <> 8) Then .Cells(5 + i, 14) = Cells(4 + i, 23) + 1
If (Cells(4 + i, 24) <> 5) Then .Cells(5 + i, 16) = Cells(4 + i, 24) + 1
If (Cells(4 + i, 24) <> 6) Then .Cells(5 + i, 17) = Cells(4 + i, 24) + 1
If (Cells(4 + i, 24) <> 7) Then .Cells(5 + i, 18) = Cells(4 + i, 24) + 1
If (Cells(4 + i, 24) <> 8) Then .Cells(5 + i, 19) = Cells(4 + i, 24) + 1
Next i
End With
End Sub
Bonjour,Sinon. ton code devrait donner ceci - si j'ai bien compris..
VB:Sub Compte_nombres_t_q_qt() Application.ScreenUpdating = False Dim i As Integer Set WSRecap = Sheets("Recap") Set WSPron = Sheets("Pronostic") With WSRecap For i = 1 To 31 If (Cells(4 + i, 22) > 3) Then .Cells(5 + i, 3) = Cells(4 + i, 22) + 1 If (Cells(4 + i, 22) <> 4) Then .Cells(5 + i, 4) = Cells(4 + i, 22) + 1 If (Cells(4 + i, 22) <> 5) Then .Cells(5 + i, 5) = Cells(4 + i, 22) + 1 If (Cells(4 + i, 22) <> 6) Then .Cells(5 + i, 6) = Cells(4 + i, 22) + 1 If (Cells(4 + i, 22) <> 7) Then .Cells(5 + i, 7) = Cells(4 + i, 22) + 1 If (Cells(4 + i, 22) <> 8) Then .Cells(5 + i, 8) = Cells(4 + i, 22) + 1 If (Cells(4 + i, 23) <> 4) Then .Cells(5 + i, 10) = Cells(4 + i, 23) + 1 If (Cells(4 + i, 23) <> 5) Then .Cells(5 + i, 11) = Cells(4 + i, 23) + 1 If (Cells(4 + i, 23) <> 6) Then .Cells(5 + i, 12) = Cells(4 + i, 23) + 1 If (Cells(4 + i, 23) <> 7) Then .Cells(5 + i, 13) = Cells(4 + i, 23) + 1 If (Cells(4 + i, 23) <> 8) Then .Cells(5 + i, 14) = Cells(4 + i, 23) + 1 If (Cells(4 + i, 24) <> 5) Then .Cells(5 + i, 16) = Cells(4 + i, 24) + 1 If (Cells(4 + i, 24) <> 6) Then .Cells(5 + i, 17) = Cells(4 + i, 24) + 1 If (Cells(4 + i, 24) <> 7) Then .Cells(5 + i, 18) = Cells(4 + i, 24) + 1 If (Cells(4 + i, 24) <> 8) Then .Cells(5 + i, 19) = Cells(4 + i, 24) + 1 Next i End With End Sub