A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

how prevent formula in cell from deleting when deleting value????



 
 
Thread Tools Display Modes
  #1  
Old September 30th, 2005, 05:42 PM
sh-boom
external usenet poster
 
Posts: n/a
Default how prevent formula in cell from deleting when deleting value????

example: =sum(a1-b1-c1) answer and formula in cell d1
if i delete the answer to this formula in cell d1 it also deletes
the formula. i want the formula to stay in the cell d1
how can formula be locked or protected in cell d1 and still make
and delete value entries in cell d1 ?????
  #2  
Old September 30th, 2005, 06:12 PM
JE McGimpsey
external usenet poster
 
Posts: n/a
Default

Your message isn't very clear. If you want the formula to remain in D1,
then it will continue to calculate.

If you mean that you want to override the formula, but have it return if
you delete the value used to override it, that will require an event
macro. One way:

Put this in your worksheet code module (right-click the worksheet tab
and choose View Code):

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count 1 Then Exit Sub
If .Address(False, False) = "D1" Then
If IsEmpty(.Value) Then
Application.EnableEvents = False
.Formula = "=A1-B1-C1"
Application.EnableEvents = True
End If
End If
End With
End Sub

(Note that the SUM() in your formula is superfluous).

In article ,
"sh-boom" wrote:

example: =sum(a1-b1-c1) answer and formula in cell d1
if i delete the answer to this formula in cell d1 it also deletes
the formula. i want the formula to stay in the cell d1
how can formula be locked or protected in cell d1 and still make
and delete value entries in cell d1 ?????

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
adding a formula in a cell but when cell = 0 cell is blank Mike T Worksheet Functions 5 May 31st, 2005 01:08 AM
How do I prevent Excel from plotting a cell w/ a formula as a "ze. Hatchet_Jack Charts and Charting 1 February 9th, 2005 10:31 PM
use a formula to create a empty cell Chas Charts and Charting 1 October 27th, 2004 11:14 PM
**Trying to use answer from another formula cell in another formula KIMBERLY Worksheet Functions 1 April 27th, 2004 06:22 PM
Formula help Wally Worksheet Functions 6 December 5th, 2003 12:18 PM


All times are GMT +1. The time now is 08:41 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.