Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Evan: Select the range you're counting before you run the macro.
Sub MyCounter() OneCounter = 0 For Each c In Selection If c.Value = 0 Then c.Offset(0, 1).Value = 0 OneCounter = 0 Else OneCounter = OneCounter + 1 If c.Offset(1, 0).Value = 0 Then c.Offset(0, 1) = OneCounter Else c.Offset(0, 1) = 0 End If End If Next c End Sub [Tested OK] Select the range you're counting before you run the macro. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
count number of repeats in a column highlight result | Excel Discussion (Misc queries) | |||
How to use pivot table to count repeats of unique fields | Excel Discussion (Misc queries) | |||
How can I count the number of repeats in a list of data? | Excel Discussion (Misc queries) | |||
Count repeats | Excel Worksheet Functions | |||
Count new occurances and not repeats | Excel Programming |