+ Reply to Thread
Results 1 to 3 of 3

How to find last cells in a column (ignoring empty space in a cell)?

  1. #1
    Forum Contributor
    Join Date
    08-20-2009
    Location
    new york
    MS-Off Ver
    Excel 2003
    Posts
    119

    How to find last cells in a column (ignoring empty space in a cell)?

    ActiveSheet.Columns(2).Find("*", , , , xlByColumns, xlPrevious).Row

    If B55 is blank (but with empty space), the code returns 55, which is NOT what I want. In this case, the last nonempty cell in Column B is above B55.

    Thanks.

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: How to find last cells in a column (ignoring empty space in a cell)?

    Well to keep things simple you COULD use code to clear the cells that are not empty first then use the code you have.

    Or you can give this a try.
    Please Login or Register  to view this content.
    If for example you want the last row in columns D:Q you could use the following.

    Please Login or Register  to view this content.
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: How to find last cells in a column (ignoring empty space in a cell)?

    Empty space with any character is not blank, hence excel thinks there is a value.
    You can try this, but you might get the same result.
    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)

Similar Threads

  1. [SOLVED] Macro to get random cell in a range (Ignoring empty cells)
    By ghoneim in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-24-2017, 11:10 AM
  2. [SOLVED] How do I find the first empty cell in a range of cells in a column
    By Nirmall in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-12-2015, 01:20 PM
  3. Replies: 5
    Last Post: 05-13-2014, 10:19 AM
  4. Need to find empty filled cells in a column and copy to the empty cell below
    By Grahamfeeley in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-30-2014, 10:09 AM
  5. [SOLVED] VBA to find last cell in a column with a value (ignoring formulas).
    By PeterR in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-03-2014, 06:03 AM
  6. [SOLVED] Find empty cell till next value merge or copy the respective cells in next column
    By rpriyadharsini1987 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-25-2013, 03:46 AM
  7. Replies: 6
    Last Post: 07-05-2005, 12:05 PM

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