+ Reply to Thread
Results 1 to 5 of 5

How to delete cells having formula with blank output?

Hybrid View

Damongz How to delete cells having... 01-10-2011, 12:43 PM
DonkeyOte Re: How to delete cells... 01-10-2011, 03:30 PM
Damongz Re: How to delete cells... 01-11-2011, 11:32 AM
DonkeyOte Re: How to delete cells... 01-11-2011, 12:17 PM
Damongz Re: How to delete cells... 01-12-2011, 03:13 PM
  1. #1
    Registered User
    Join Date
    01-10-2011
    Location
    Houston
    MS-Off Ver
    Excel 2007
    Posts
    3

    How to delete cells having formula with blank output?

    My worksheet has some cells containing formula, but the output of the formula in these cells are blanks. How can I delete them with macros? I tried this one:
    Sheets("Output").Select
    Selection.SpecialCells(xlCellTypeBlanks).Delete (xlShiftUp)
    But the macros said no blank cells was found. Any advice is welcome. Thanks alot.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: How to delete cells having formula with blank output?

    A Blank is a cell devoid of all content (including formulae)
    Nulls are Text Strings (0 length)

    Without knowing what else resides on your sheet you might consider using

    SpecialCells(xlCellTypeFormulas,xlTextValues)
    and iterating resulting range checking for Nulls.
    (alternatively you might be able to delete en masse - we simply don't know what is feasible at this stage given we have no knowledge of other data types etc)

  3. #3
    Registered User
    Join Date
    01-10-2011
    Location
    Houston
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: How to delete cells having formula with blank output?

    Thanks for your reply.
    In my worksheet, all the cells are results of formulas. But based on condition, some cells will have blank output. I want to remove the cells having "blank" output.
    And I tried your suggested code. It changed all the cells with output of text values.

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: How to delete cells having formula with blank output?

    Quote Originally Posted by Damongz
    I tried your suggested code. It changed all the cells with output of text values.
    I think I made the point that pending other values you would use the SpecialCells to identify possible locations:

    Quote Originally Posted by D.O
    ...iterating resulting range checking for Nulls.
    You need to check the value of each formula text string to see if it's a Null or not.

    Hopefully you can appreciate that based on what you've told us we are effectively having to resort to "shooting in the dark"

  5. #5
    Registered User
    Join Date
    01-10-2011
    Location
    Houston
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: How to delete cells having formula with blank output?

    Thanks. I got your point and really appreciated your help.

+ 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