Hi
How do I delete the contents of a cell but not the formula that is in the cell?
Thanks...
Hi
How do I delete the contents of a cell but not the formula that is in the cell?
Thanks...
That's not possible. You could delete the data in the cells the formula is calculating from. You can also make a cell look empty if a certain condition within the formula is met, what does for formula look like?
You should hit F5, because chances are I've edited this post at least 5 times.
Example of Array Formulas
Click the * below on any post that helped you.
Can you post an example of what you want to do?
I would like to delete the data in the cells the formula is calculating from.
All you need to do, is delete that data. If this causes your formula to produce an error or 0, you can fix that by adjusting your formula to something like...
=IF(the-cell-you-deleted="","",your-formula)
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
I'm with FDibbins, just delete the data and use the IF. If the formula is complex and relies on many cells then deleting just a few may result in #ERR or #N/A (or a multitude or other #problems). To make it pretty I usually use IF(ISERROR(your-formula),"[anything you want]",your-formula).
If you post a sample formula that is returning an unwanted error, we'll see if we can help restructure it.
dingdong, I see that you are using 2013, that has the IFERROR() function available to you, so the formula then necomes...
=IFERROR(your-formula,"[anything you want]")
Hi Ron
Example as requested.Example.xlsmExample.xlsm
Oh, for goodness sake...You're running a MACRO!
• Right-click on the CLEAR button
• Select Assign Macro
...Click: Edit
• Replace your code with this code:
The current code clears columns B:G...instead of B:EPlease Login or Register to view this content.
Does that help?
example.xlsxOK, I wll try the macro later.
Please see the attached example for the original problem of how to delete the contents of a cell without deleting the formula.
Thanks...
Please explain exactly what you mean by "clear the contents of I8 without deleting the formula".
Using your example
G8: 4
H8: 5
I8: =SUM(G8+H8)
...which is probably the wrong way to do that.
...it should be =SUM(G8:H8)
So...using that example.
What do you want to do and what do you want to see after the adjustment?
Hi
After the calculation the contents of cell i8 need to be deleted to allow the next calculation. when i8 is highlighted and you press delete the formula is deleted along with the contents.
So, How do I delete the contents of a cell without deleting the formula that is contained in the cell?
So, How do I delete the contents of a cell without deleting the formula that is contained in the cell?
If a cell has a formula in it, then the formula IS the contents of a cell. Please rephrase your question, you are basically asking how do i delete something without deleting it.
This does not make sense to me. The way spreadsheets work, there should be no need to do anything to I8 to prepare it for next calculation. Assuming calculation mode is set to automatic, anytime G8 or H8 change, I8 should automatically update to reflect the change. Perhaps if you explain in more detail what you mean by "allowing the next calculation" in I8, we can better understand what you are trying to convey with this question.After the calculation the contents of cell i8 need to be deleted to allow the next calculation.
Originally Posted by shg
I've tried to combine the answers previously given to you. You have given two examples so because they are quite different two files are returned.
Maybe you are just a misunderstanding what has been provided to you. At the same time, your instructions are confusing. In one instance you imply that you want the form cleared without deleting the formulae and in another instance you refer to a single cell.
The macro file will clear the whole form.
Last edited by newdoverman; 10-21-2014 at 11:13 AM.
<---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.Ron W
all I want to do is highlight a cell and press delete or clear and the value in the cell disappears but the formula stays in the cell.
One last attempt before my pliers wear out...
You cannot delete a formula...and HAVE a formula.
Do you want the formula in I8 to show nothing if there are no numbers in G8 and H8?
If yes: this formula returns an "empty cell" if G8 and H8 do not contain numbers
Please Login or Register to view this content.
Not sure exactly how do you want to achieve that but please find the attached sheet and click on the buttons to see if this is something you are trying to achieve since this is the only solution which strikes to my mind after reading all your replies.
Last edited by sktneer; 10-21-2014 at 01:03 PM.
Regards
sktneer
Treat people the way you want to be treated. Talk to people the way you want to be talked to.
Respect is earned NOT given.
OK - Thanks, I will try this one.
I guess it can't be done by pressing delete on the keyboard, thanks for your help.
The code for the macro clear works perfectly.
Thanks again.
Thank you Sktneer, this is a very good solution.
You're welcome. Glad I could help and thanks for the feedback as well.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks