Solved

# Count the number of cells with text below a number and output the result in separate columns

Posted on 2013-05-16

Hi<

I have a fairly straightforward problem - unfortunately, I am in a bit of a time crunch. The issue is that have one column of cells which contain either cells with only numbers or cells that are mostly text but may include a number at the beginning of the variable - the last character would always be text though.. I need to count the number of cells with text in them below each cell that contains a number and then write the count beside that cell with the number in it. For example here is my column:

1111

erere

2227

ggg

1313

cv

df

gh

1557

df

1gh

ty

yu

5nm

io

2223

uy

bn

qk

dk

wk

So what I would like to end up with is a macro or vba routine that will output the following in a different columns nearby:

1111 1

2227 1

1313 3

1557 6

2223 5

This is just a sample - the actual column contains approximately 3400 cells with probably approx 2000 containing numbers with varying numbers of cells below each of them containing text (and perhaps starting with a number).