+ Reply to Thread
Results 1 to 2 of 2

Test if cell is blank

  1. #1
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Test if cell is blank

    I have a change event, and I want to test if the target cell is blank

    MsgBox IsEmpty (Target) and MsgBox (Target.Value) always yield False.

    Len(Target.Value) = 0 yields an error message.

    Target.Value = "" yields an error message

    Application.WorksheetFunction.IsBlank is not a valid function.

    MsgBox target.value yields an error when the target is blank.


    So there are 5 ways that do not work. Any ideas what might work?

    Here is the pertinent part of the code. You can test it on Column B.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Test if cell is blank

    I found the problem. The target is a merged cell. So target.address is something like B12:H12. IsEmpty evaluates the whole range. So I amended the code:
    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] If to test the value of the cell is blank cell.
    By IonutC in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-03-2016, 02:12 PM
  2. Replies: 3
    Last Post: 08-21-2013, 07:10 PM
  3. [SOLVED] How do I add a Test for Blank Cell to formula below?
    By Aceso in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-29-2013, 06:11 PM
  4. Macro code to test for blank row and insert blank row if false
    By Mattie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-28-2006, 08:25 PM
  5. [SOLVED] A logical test in the If function for blank, i.e., If blank?
    By egii in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-01-2006, 03:40 PM
  6. [SOLVED] SUMIF test for blank/empty cell????
    By Fred Holmes in forum Excel General
    Replies: 4
    Last Post: 10-12-2005, 05:05 PM
  7. Replies: 0
    Last Post: 03-24-2005, 08:06 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