Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a cell with a formula which returns a date. I would like to convert
the formula in the cell to it's result if another cell is 0. Can I do that? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi BHTay
You can use the change event to do this if another cell is 0 Do you change this cell manual or is it also a formula ? -- Regards Ron de Bruin http://www.rondebruin.nl "BHTay" wrote in message ... I have a cell with a formula which returns a date. I would like to convert the formula in the cell to it's result if another cell is 0. Can I do that? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Ron de Bruin,
Thanks for the quick response. The other cell is a fomula. "Ron de Bruin" wrote: Hi BHTay You can use the change event to do this if another cell is 0 Do you change this cell manual or is it also a formula ? -- Regards Ron de Bruin http://www.rondebruin.nl "BHTay" wrote in message ... I have a cell with a formula which returns a date. I would like to convert the formula in the cell to it's result if another cell is 0. Can I do that? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this event in a sheet module
If the formula in B1 0 then the formula in A1 change to a value Private Sub Worksheet_Change(ByVal Target As Range) Dim rng As Range If Target.Cells.Count 1 Then Exit Sub On Error GoTo EndMacro If Not Target.HasFormula Then Set rng = Target.Dependents If Not Intersect(Range("B1"), rng) Is Nothing Then If Range("B1").Value 0 Then Range("A1").Value = Range("A1").Value End If End If End If EndMacro: End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "BHTay" wrote in message ... Hi Ron de Bruin, Thanks for the quick response. The other cell is a fomula. "Ron de Bruin" wrote: Hi BHTay You can use the change event to do this if another cell is 0 Do you change this cell manual or is it also a formula ? -- Regards Ron de Bruin http://www.rondebruin.nl "BHTay" wrote in message ... I have a cell with a formula which returns a date. I would like to convert the formula in the cell to it's result if another cell is 0. Can I do that? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Ron. This seems to do the job.
"Ron de Bruin" wrote: Try this event in a sheet module If the formula in B1 0 then the formula in A1 change to a value Private Sub Worksheet_Change(ByVal Target As Range) Dim rng As Range If Target.Cells.Count 1 Then Exit Sub On Error GoTo EndMacro If Not Target.HasFormula Then Set rng = Target.Dependents If Not Intersect(Range("B1"), rng) Is Nothing Then If Range("B1").Value 0 Then Range("A1").Value = Range("A1").Value End If End If End If EndMacro: End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "BHTay" wrote in message ... Hi Ron de Bruin, Thanks for the quick response. The other cell is a fomula. "Ron de Bruin" wrote: Hi BHTay You can use the change event to do this if another cell is 0 Do you change this cell manual or is it also a formula ? -- Regards Ron de Bruin http://www.rondebruin.nl "BHTay" wrote in message ... I have a cell with a formula which returns a date. I would like to convert the formula in the cell to it's result if another cell is 0. Can I do that? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Convert formula result to string | Excel Discussion (Misc queries) | |||
How do I convert the result of a formula in a field into a value | Excel Worksheet Functions | |||
How do I convert formula result into numbers so I can sum results? | Excel Discussion (Misc queries) | |||
How can I convert the result of a formula to a whole number? | Excel Discussion (Misc queries) | |||
Convert Formula Result | Excel Worksheet Functions |