VBA/Excel/Access/Word/Excel/Count

Материал из VB Эксперт
Перейти к: навигация, поиск

Count a range

 
Sub addAmtRel()
    Set myRange = Range(ActiveCell, ActiveCell.End(xlUp))   "   Substitute your range here
    myCount = Application.Count(myRange)
    ActiveCell.Formula = "=SUM(R[" & -myCount & "]C:R[-1]C)"  "   Substitute your cell address here
End Sub