+ Reply to Thread
Results 1 to 5 of 5

Select last cell before blank, then offset

  1. #1
    Registered User
    Join Date
    08-23-2007
    Posts
    58

    Select last cell before blank, then offset

    Hello,

    I have this simple code which selects the last cell before a blank.

    Please Login or Register  to view this content.
    My initial goal was to select the blank cell itself.

    I've tried adding numerous variations of (offset=-1), with little luck.

    What can I add which will offset the selection 1 cell down to select the blank cell?


    Thanks for any help.

    Jeff

  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 Jeff.p,

    Start at the end of the worksheet and move up. Some people use 65536 in place of Rows.Count. Excel 2007 supports more than 65536 rows. This way works for all versions.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Remember, you generally do not need to select the cell.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    08-23-2007
    Posts
    58
    Thanks, Leith for the reply,


    Sadly I'm receiving this error.

    compile error
    Expected End Sub



    Tried adding an End Sub, but no luck

    any ideas?

  5. #5
    Registered User
    Join Date
    08-23-2007
    Posts
    58
    ...just figured it out.



    Please Login or Register  to view this content.

+ 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