Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
count
Hi, if ive selected range("a5") with vba and id like ti count how many
number = to 21 are in a2:a5 then move to a9 and again count 21s in a6:a9 and continue moving down the column. I can move down ok, just dont know how to count for 21, in every 4 cells. Its important that its every 4 cells and not 21s in the whole colums, because these are dailly results which collect 4 values each day. Any ideas appreciated. Regards Robert |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
count
Sub ShowCnt()
Dim lastrow as Long, i as Long Dim rng as Range lastrow = cells(rows.count,1).End(xlup).row for i = 2 to lastrow step 4 set rng = cells(i,4).Resize(4,1) cnt = application.Countif(rng,21) msgbox rng.Address & ": " & cnt Next End Sub wrote in message oups.com... Hi, if ive selected range("a5") with vba and id like ti count how many number = to 21 are in a2:a5 then move to a9 and again count 21s in a6:a9 and continue moving down the column. I can move down ok, just dont know how to count for 21, in every 4 cells. Its important that its every 4 cells and not 21s in the whole colums, because these are dailly results which collect 4 values each day. Any ideas appreciated. Regards Robert |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
count
Thanks Tom brilliant.
Regards Robert |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Multiple Criteria, Count If, Sum Product to get count across range | Excel Worksheet Functions | |||
Count Employee Work Time - Don't Count Duplicates | Excel Worksheet Functions | |||
Count Employee Work Time - Don't Double-count Overlapping Apts. | Excel Worksheet Functions | |||
Excel 2000, count, sort a list & count totals? | Excel Worksheet Functions | |||
Count Intervals of Filtered TEXT values in Column and Return Count across a Row | Excel Worksheet Functions |