Find end of list - new problem
Maria,
As Don explained, the original formula started from the bottom of the
spreadsheet in column A, and worked its way up until it finds a non-empty
row. This way we get the last non-empty cell, even if there some embedded
empty cells in-between.
But, the column, A, was hard-coded. So what I did was to take the first
column (Cells(1,1).Column) of the UsedRange (the rectangular part of the
spreadsheet bounding the cells that have been used) instead of hard-coded A.
The idea is that it should pick up the first real column regardless of where
used.
--
HTH
RP
(remove nothere from the email address if mailing direct)
"Maria" wrote in message
...
I'd like to. What does the command stand for? I don't
understand it properly. I've never heard
of "Usedrange" ... Maybe you could explain it whenever you
find some time.
Thanks a lot,
Maria
-----Original Message-----
Maria,
You could also try
With Activesheet
iLastRow =
..Cells(.Rows.Count,.Usedrange.Cells(1,1).Column) .End
(xlUp).Row
End With
--
HTH
RP
(remove nothere from the email address if mailing direct)
|