View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Freeze formula results

Hi
without using VBA (e.g. processing the worksheet_change event) this is
IMHO not possible. You may the following code (put it in your worksheet
module):

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Me.Range("A1:C1")) Is Nothing Then Exit Sub
On Error GoTo CleanUp:
If Range("C1").value <"" and Range ("D1").value = "" then
Application.EnableEvents = False
Range("D1").value = Range("C1").value
end if

CleanUp:
Application.EnableEvents = True
End Sub



--
Regards
Frank Kabel
Frankfurt, Germany

Is there any way to define a function that would copy the result of
one formula (from one cell) onto another cell and then erase itself
so the copied result would not be recalculated?

I.e:

In cell C1 I would have (=A1+B1). The idea is to put in cell D1 a
function like

=IF(C1<"","",Freeze())

And Freeze() would be the defined function that would copy the result
from cell C1 to cell E1 and then would erase the IF function so no
matter if I change the values in A1 or B1 the value of D1 will stay
the same.

Thanks in advance


---
Message posted from http://www.ExcelForum.com/