I have a long (2,000 + rows) list of different values. I am trying to find the first and last row for each value. As an example (note: all data is in one column):
Bats
Bats
Bats
Bats
Bats
Bats
Fun
Fun
Fun
Fun
Bases
Bases
Bases
Bases
Bases
Bases
Bases
Bases
Bases
Bases
Bases
Balls
Balls
Balls
Balls
Balls
Balls
Balls
Balls
How do I find the first row (starting at the top) and last row containing each word. Bats starts row 1, ends at row 6. Fun starts row 7, ends at row 10.
Any ideas for a quicker way to do this, other than a loop where I compare each cell to the previous, and add a row variable if they're different?
Looking for how to do so in VBA.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…