+ Reply to Thread
Results 1 to 2 of 2

Offset Not Working

  1. #1
    Registered User
    Join Date
    03-10-2005
    Posts
    8

    Offset Not Working

    Why am I not getting the next blank cell when I use the offset property? It was working fine for me and now all of a sudden it decided to quit.

    Selection.End(xlDown).Select
    ActiveCell.Offset(0, 1).Activate

    when debugging, the first line shows as 8 (the last filled cell). The second line shows as B65536, which is not the next empty cell in the next column, which is what I want to select.

    Am I misunderstanding offset?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Sleah,

    Your understanding of Offset is fine. It's the peculiar and undocumented action of the End property. End examines the starting cell to determine where the End of the selection is. If the start cell is non Blank it will search the range until it finds the last non Blank cell. If End starts with a Blank cell it will search until it finds the last Blank cell.

    To solve your problem start searching your Column from the bottom up. The likelihood of the last cell not being a blank is remote.

    Solution:

    C = ActiveCell.Column
    R = ActiveSheet.Rows.Count
    ActiveSheet.Cells(R, C).End(xlUp).Select
    ActiveCell.Offset(0, 1).Activate


    Sincerely,
    Leith Ross

+ 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