+ Reply to Thread
Results 1 to 4 of 4

Clear contents/keep formula

Hybrid View

  1. #1
    Flopp2
    Guest

    Clear contents/keep formula

    How do you clear the contents of a cell but keep the formula? Also, how do I
    program that if answer is 0 then leave cell blank instead of putting in the
    zeros? Thank you

  2. #2
    Tom Ogilvy
    Guest

    Re: Clear contents/keep formula

    You don't. The formula produces a result and that is what is displayed.
    You could possibly change all the font colors to match the background color
    or you could adjust all your formulas to do something like this

    =if(A1<>"",currentformula,"")

    then if you cleared A1, all cells would look blank.

    You could use a similar construct to appear blank if the formula returns a
    zero.

    =if(A1<>"",if(currentformula=0,"",currentformula),"")


    --
    Regards,
    Tom Ogilvy

    "Flopp2" <[email protected]> wrote in message
    news:[email protected]...
    > How do you clear the contents of a cell but keep the formula? Also, how

    do I
    > program that if answer is 0 then leave cell blank instead of putting in

    the
    > zeros? Thank you




  3. #3
    lschuh
    Guest

    Re: Clear contents/keep formula

    Maybe I have been asking the wrong question as you have offered me plenty of
    help. "vba code doesn't work". What this guy is asking is kind of what I
    want to do. I have cell references to another worksheet which if there is no
    data then it displays 0. Your idea of changing the background color to match
    fonts or visa versa might be the ticket. You see the length of my worksheet
    keeps changing depending of how much data is being transferred in and all I
    basically wanted to do is clean up the cosmetics of the worksheet. Is this
    your suggestion for me?

    "Tom Ogilvy" wrote:

    > You don't. The formula produces a result and that is what is displayed.
    > You could possibly change all the font colors to match the background color
    > or you could adjust all your formulas to do something like this
    >
    > =if(A1<>"",currentformula,"")
    >
    > then if you cleared A1, all cells would look blank.
    >
    > You could use a similar construct to appear blank if the formula returns a
    > zero.
    >
    > =if(A1<>"",if(currentformula=0,"",currentformula),"")
    >
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "Flopp2" <[email protected]> wrote in message
    > news:[email protected]...
    > > How do you clear the contents of a cell but keep the formula? Also, how

    > do I
    > > program that if answer is 0 then leave cell blank instead of putting in

    > the
    > > zeros? Thank you

    >
    >
    >


  4. #4
    Tom Ogilvy
    Guest

    Re: Clear contents/keep formula

    for the zero appears blank question, a better approach might be to do
    Tools=>Options=>View and uncheck Zero Values.

    --
    Regards,
    Tom Ogilvy


    "Flopp2" <[email protected]> wrote in message
    news:[email protected]...
    > How do you clear the contents of a cell but keep the formula? Also, how

    do I
    > program that if answer is 0 then leave cell blank instead of putting in

    the
    > zeros? Thank you




+ 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