Count series in range

  • Thread starter Thread starter rjhare
  • Start date Start date
R

rjhare

I am writing an Excel function in VBA, but I am stuck on this:

I need to count the number of series in a range:

A column has a several ranges of numbers, split by blank cells:

1
0.5
1


1
1
1
1
1

1
1

I need to count the series of numbers, which in this case 3: (1, 0.5,1
and (1,1,1,1,1) and (1,1)

How do I do this from a passed range in VBA, please

Thank
 
rng.specialcells(xlconstants,xlnumbers).Areas.count

where rng represents the passed range.
 
Thanks, but this did not work for me (XL2k on W2kSP4)

I have managed a workaround though.

Thanks to all those that viewe
 
Great, but
Just others are not deceived by your inability to implement and are not
forced to employ some cumbersome workaround

from the immediate window:

set rng = Columns(1)
? rng.specialcells(xlconstants,xlnumbers).Areas.count
8
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top