Unable to get last filled cell address from Range.End(xlDown) method

V

vedpatel

The scenario is like this. I have one .Xla file which has a functio
called generateReport(). This function will retrieve the data fro
Database and display in excel sheet.

Multiple Queried will be executed by generateReport(). I need to kno
the last filled Row cell so that I can start next value form the nex
row. For this purpose I have used Range.End(xlDown) method to know th
last filled cell. But while debugging I found that xldown value i
-4121 and this method will return last row cell address. i.e. $A$65536
so if I tried to move to next row (Set Range.Offset(2, 0)) then runtim
error will be displayed. Who to resolve this problem? Is there is an
other method to get last filled cell address?

This .Xla file function will be called from VB application.

Thanks
Ve
 
B

Bob Phillips

See other post.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top