+ Reply to Thread
Results 1 to 4 of 4

Delete formula

  1. #1
    Forum Contributor
    Join Date
    08-15-2006
    Location
    USA
    MS-Off Ver
    Office 365, 64 bit
    Posts
    362

    Delete formula

    I need a code that will recognize when D5 is blank that it will delete / empty the contents of E5 automatically (and so on for D6 and E6). I want it to occur for D5:E6 thru D41:E41.

    Thanks,,,

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Delete formula

    Hi,

    This code will do what you want. You will need to adjust the sheet reference as required.

    Please Login or Register  to view this content.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Contributor
    Join Date
    08-15-2006
    Location
    USA
    MS-Off Ver
    Office 365, 64 bit
    Posts
    362

    Re: Delete formula

    thanks for the reply. Where do i place the code? It's not working so i may be doing something wrong....

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Delete formula

    "Delete" sounds like an action and not a calculation. In this forum we are looking to solve things with worksheet formulas.

    Do the cells you want emptied have values in them or formulas? If formulas, we can adjust the formula to stay visually "blank" when D5 is empty. Like so:

    E5:
    =IF(D5="", "", yourcurrentformula)

    If you want values to get removed, you'd need to post your question and a sample worksheet in the Programming forum.

    EDIT: Sorry, sweep has offered a programming solution. Although it's not automatic and only applies to one row, it is a start in the direction you've described.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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