+ Reply to Thread
Results 1 to 2 of 2

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

  1. #1
    Registered User
    Join Date
    02-28-2006
    Posts
    2

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

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

    Multiple Queried will be executed by generateReport(). I need to know the last filled Row cell so that I can start next value form the next row. For this purpose I have used Range.End(xlDown) method to know the last filled cell. But while debugging I found that xldown value is -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 runtime error will be displayed. Who to resolve this problem? Is there is any other method to get last filled cell address?

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

    Thanks
    Ved

  2. #2
    Bob Phillips
    Guest

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

    See other post.

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "vedpatel" <[email protected]> wrote in
    message news:[email protected]...
    >
    > The scenario is like this. I have one .Xla file which has a function
    > called generateReport(). This function will retrieve the data from
    > Database and display in excel sheet.
    >
    > Multiple Queried will be executed by generateReport(). I need to know
    > the last filled Row cell so that I can start next value form the next
    > row. For this purpose I have used Range.End(xlDown) method to know the
    > last filled cell. But while debugging I found that xldown value is
    > -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 runtime
    > error will be displayed. Who to resolve this problem? Is there is any
    > other method to get last filled cell address?
    >
    > This .Xla file function will be called from VB application.
    >
    > Thanks
    > Ved
    >
    >
    > --
    > vedpatel
    > ------------------------------------------------------------------------
    > vedpatel's Profile:

    http://www.excelforum.com/member.php...o&userid=31987
    > View this thread: http://www.excelforum.com/showthread...hreadid=517209
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1