1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| Sub Essai_comptage()
'Déclaration des variables -------------------
Dim X As Long
Dim V As Long
Dim E As Long
Dim Nb_Cel As Integer
Dim Cel As Range
' -------------------------------------------------
Range("C65536").End(xlUp).Offset(0, 0).Select
For Each Cel In Range("B:B")
If Cel.Value = "N" Then Nb_Cel = Nb_Cel + 1
Next Cel
' --------------------------------------------------
X = Nb_Cel + 4
Range("G5").Select
ActiveCell.FormulaR1C1 = X & " lignes dans le programme"
' --------------------------------------------------
Range("b3").End(xlDown).Offset(1, 1).Select
E = (X - 1) * 10
ActiveCell.FormulaR1C1 = "=R[-1]C+10"
Range("B3").End(xlDown).Offset(1, 0).Select
ActiveCell = "N"
End Sub |
Partager