+ Reply to Thread
Results 1 to 4 of 4

delete cell if condition is met

  1. #1
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,956

    delete cell if condition is met

    This one should be easy, but I'm drawing a blank. I have columns of data. What I want to do is this: If A1 is empty, delete B1(or maybe C1 or D1, depending on where I use this). Looking on the internet all I can find is how to delete an entire row.
    Last edited by jomili; 04-07-2010 at 10:45 AM. Reason: Solved it myself

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: delete cell if condition is met

    Hi,

    Just filter your data for blanks in column A, then select all the cells in the filtered rows and hit the delete key.

    Rgds
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,956

    Re: delete cell if condition is met

    That would work if I were doing this manually. This is part of a much larger macro I'm writing for my users to be able to cross check two reports. I've attached a sample of what I'm working from. The idea is to boil out only the differences from the two reports

    Columns A and B show the Posn Func code# and quantify from one report (APR)
    Columns D,E and F show the same information and the title from another report (ESS)
    Column H is the difference in quantity between the two.
    Column C is what I'm working on now. I have a VLookup pulling the Posn Func title from the APR (based on if there's a value in B). What I'd like to do is one of two things:

    A) Modify my vlookup to NOT display if there's a value in D or E.
    OR
    B) Clear the contents of C if there's a value in D or E.

    Looking at the example, in this case the only titles I'd like showing would be the ones in C4, C7, and C9.

    here's what my Vlookup looks like:
    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,956

    Re: delete cell if condition is met

    Okay, I guess I'll mark this one solved, 'cause I found an answer myself. The code below looks at the value in D, and if it's NOT empty it clears the contents of the corresponding cell in the C column.

    For anyone else looking for this, to change it to where it deletes if the cell IS empty, just delete the "= False" part of 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)

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