find last row with data in it

J

johnb

Hi all,

I have ssheet thats an daily output from a SAP system and
data is all over the place with many empty columns and
rows. The number of rows change daily and range from a
few hundred to 65000. I current use a For Next loop to
search to whole ssheet and its works fine. But
having "For 1 to 65536" seems a bit crude when there is
only a few hundred rows to read there must be a better
way. Advice welcome.

TIA
johnb
 
K

Kassie

Rather use a macro that goes to the last row (65000), in the column you
prefer. Then do an <End><Up> to the last filled cell in that column.
 
B

Bob Phillips

For i = 1 To Cells(Rows.Count,"A").End(xlUp).Row
....

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Top