EOF general usage
try this
dim rng as range
set rng=activesheet.usedrange
for n= 1 to rng.rows.count
do your stuff
next
--
hemu
"pvdalen" wrote:
Howdy,
I have a sheet in which I want to run a macro to cycle through the sheet and
perform some operations. Well, I guess that's pretty obvious......anyway,
the number of rows will not be the same from use to use, so I wanted to loop
the file with
Do While Not EOF
but, I get an "Argument not optional" message. I was hoping that since the
data to be parsed is in the sheet itself that I wouldn't have to open it as a
file or a recordset and use EOF as a function of those, but it looks like I'm
wrong? Can someone educate me, please?
Oh, the reason I'm shying away from
Cells(Rows.Count, column).End(xlUp).Row
is that it's not clear what the lowest limit of each column might be. I
just might end up using that on a few columns and going with the lowest
number....
Thanks very much.
|