View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Michaelc Michaelc is offline
external usenet poster
 
Posts: 4
Default Function Required

I have a 2,000 row column (A) that contains either positive or negative
numbers.
In an adjacent column (B) I need a user defined function in each row which
counts how many rows preceding the active row in Column A contain unbroken
strings of either positive (or negative) numbers.
So for example the function in cell B2000 would determine that A2000 was,
say, positive, and then return a value that counted how many consecutive
cells preceding A2000 were also positive, before changing to negative.
I am sure I could, eventually, come up with some VBA code that looped until
while counting, but would find a Function much more useful.
As always, all suggestions and assistance will be much appreciated.
MichaelC