View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Count consecutive cells then start over

It WAS tested.

I didn't but you may need this as the first line in the function.
Application.Volatile

Did you place in a regular module?
Did you change "e" to your column that has the string of 1's?
Is calculation set to automatic? Touch f9 key to calculate

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"John67" wrote in message
...
Thanks Don, but unfortunately it didn't do anything. I do appreciate the
help all the same.


"Don Guillett" wrote:

If a function is desired, use this formula in any cell desired to locate
the
7th consecutive.
=so("e")

Put the below function into a REGULAR vba module
Function so(mc)
c = 0
For i = 2 To Cells(Rows.Count, mc).End(xlUp).Row
If Cells(i + 1, mc) = 1 And Cells(i, mc) = 1 Then
c = c + 1
Else
c = 0
End If
'MsgBox c
If c = 7 Then
so = Cells(i, mc).Address
'Cells(1, mc) = Cells(i, mc).Address
Exit For
End If
Next i
End Function


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Herbert Seidenberg" wrote in message
...
Or without VBA
and without counting 8x's 9x's ...
http://www.freefilehosting.net/download/3aee3