Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Convert a formula in a cell to it's result

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Convert a formula in a cell to it's result

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Convert a formula in a cell to it's result

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Convert a formula in a cell to it's result

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Convert a formula in a cell to it's result

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert formula result to string Dennis Excel Discussion (Misc queries) 1 April 24th 09 06:41 AM
How do I convert the result of a formula in a field into a value Hicks Excel Worksheet Functions 2 December 5th 07 02:50 PM
How do I convert formula result into numbers so I can sum results? Barsha Excel Discussion (Misc queries) 1 November 11th 06 07:18 PM
How can I convert the result of a formula to a whole number? crystal Excel Discussion (Misc queries) 1 April 28th 06 07:06 AM
Convert Formula Result Christina Excel Worksheet Functions 2 October 12th 05 10:30 PM


All times are GMT +1. The time now is 05:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"