+ Reply to Thread
Results 1 to 5 of 5

How to identify blank cells?

  1. #1
    Forum Contributor
    Join Date
    09-10-2016
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    680

    How to identify blank cells?

    E2:E631091 and P2:P631091 are blank, at least they look blank. I expect LastRowE to be 1, instead LastRowE = 631091 , why?

    It seems that when a cell = "", it is not really blank, although it looks like blank.

    How to fix the issue? I want LastRowE to be 1 (only title row), not 631091. There is no data in E2:E631091

    I think I need different code for LastRowE, maybe Rows.Count does not work correctly.

    Please Login or Register  to view this content.
    Attached Images Attached Images
    Last edited by VAer; 03-20-2024 at 04:15 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,446

    Re: How to identify blank cells?

    Do it like this:

    Please Login or Register  to view this content.
    In the absence of a Sample workbook, I created one.
    Attached Files Attached Files
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,223

    Re: How to identify blank cells?

    If a formula in a cell returns an empty string, and then you copy that cell and paste it as a value, the cell is only apparently empty.
    You have at least 2 solutions.
    1. you can use the following function to find the last non-empty cell:
    Please Login or Register  to view this content.
    2. Before searching for the last non-empty cell using Range.End(xlUp), clean up the column (you can only do one at a time!) using the "Text as columns" functionality or the following macro:
    Please Login or Register  to view this content.
    Artik

  4. #4
    Forum Contributor
    Join Date
    09-10-2016
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    680

    Re: How to identify blank cells?

    Thank you, all.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,446

    Re: How to identify blank cells?

    You're welcome.



    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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. Replies: 4
    Last Post: 04-15-2020, 04:48 PM
  2. VBA Identify and Create Ranges based on Blank Cells
    By theskyscraper1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-09-2017, 10:27 PM
  3. How to identify blank/empty cells
    By Thelxi in forum Excel General
    Replies: 3
    Last Post: 08-14-2014, 12:42 AM
  4. [SOLVED] Select variable range; identify & delete rows with blank cells
    By alter54 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-28-2013, 04:40 PM
  5. Identify & highlight if all cells in a fixed range are blank
    By heena.singh in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-24-2013, 05:57 AM
  6. Identify Blank cells with Missing Data
    By Cortlyn in forum Excel General
    Replies: 3
    Last Post: 11-05-2012, 01:04 PM
  7. [SOLVED] [SOLVED] How do I identify blank cells?
    By peanburn in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 02-18-2006, 09:35 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