Selection.End

B

Brad E

I would like to get the value of the number of rows
between two entries, using VB. My spreadsheet is this:
| A | B |...
1|xx1|yyy|
2| |yyy|
3| |yyy|
4| |yyy|
5|xx2|yyy|
6| |yyy|
.....

and my Active Cell is A2. The number of rows between xx1
and xx2 differ from xx2/xx3, and so on. What macro can I
use to put a 3 in cell A2? The 3 would come from counting
rows 2,3,4.

In a formula, it would be =ROW(A5)-ROW(), but how do I get
the macro to use "Selection.End(xlDown)"?

I have a huge spreadsheet and I really need this to work.
If you think you could help but need more info, please
feel free to e-mail me. Thanks, Brad E.
 

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

Top