Click here to Skip to main content
16,016,501 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

How can I make my macro read the line until it has some values in it.

Ie; Now I specify a range of values, say(Range A1:A1000). But not always there are 1000 values. There can be a 800 or 1200.
In this case how do I code in macro such that as soon as the program reaches a line with no values, it stops?

Need some help please.
Posted
Updated 9-Jul-12 22:48pm
v2

1 solution

use below code and the count will give end of row having value

Range("A1").Select
Range(Selection, Selection.End(xlDown)).Count
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900