1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| Sub calculG()
Dim CA(1 To 6) As Integer
Dim CB(1 To 6) As Integer
Dim cel As Range
Dim ligne As Long, i As Long
With Sheets("BD1")
ligne = .UsedRange.Rows.Count
For i = 3 To ligne
CA(.Cells(i, 12).Value) = CA(.Cells(i, 12).Value) + 1
Next i
End With
With Sheets("BD2")
ligne = .UsedRange.Rows.Count
For i = 3 To ligne
CB(.Cells(i, 12).Value) = CB(.Cells(i, 12).Value) + 1
Next i
End With
With Sheets("calcul")
For i = 1 To 6
.Cells(13, i + 2).Value = CA(i) + CB(i)
Next i
End With
End Sub |