![]() |
Cell Formulas
Hello, What formula will allow me to input a number % in (B 2) to find $25,000 or input a number $25,000 in (C 2) to find 10% in (B 2) without erasing the cell's formulas? A B C 1 Sales Price: $250,000 2 Down Payment: 10% 25,000. 3 1st Mortgage 80% 200,000. 4 2nd Mortgage 10% 25,000. -- BRustigian ------------------------------------------------------------------------ BRustigian's Profile: http://www.excelforum.com/member.php...fo&userid=4345 View this thread: http://www.excelforum.com/showthread...hreadid=566873 |
Cell Formulas
A cell either contains either a value OR a formula, not both. You will have
to use VBA to accomplish what you want. Right click on the sheet tab, and copy/paste code below. Assumes that Sale Price will always be in cell(1,"C"). Private Sub Worksheet_Change(ByVal Target As Range) On Error GoTo wsexit Application.EnableEvents = False If Target.Column = 2 Then Cells(Target.Row, 3).Value = Cells(1, "C") * Target.Value Else If Target.Column = 3 Then Cells(Target.Row, 2).Value = Target.Value / Cells(1, "C") End If End If wsexit: Application.EnableEvents = True End Sub "BRustigian" wrote: Hello, What formula will allow me to input a number % in (B 2) to find $25,000 or input a number $25,000 in (C 2) to find 10% in (B 2) without erasing the cell's formulas? A B C 1 Sales Price: $250,000 2 Down Payment: 10% 25,000. 3 1st Mortgage 80% 200,000. 4 2nd Mortgage 10% 25,000. -- BRustigian ------------------------------------------------------------------------ BRustigian's Profile: http://www.excelforum.com/member.php...fo&userid=4345 View this thread: http://www.excelforum.com/showthread...hreadid=566873 |
Cell Formulas
Sorry, missing info ...
Right click on the sheet tab, VIEW CODE and copy/paste code below .... "Toppers" wrote: A cell either contains either a value OR a formula, not both. You will have to use VBA to accomplish what you want. Right click on the sheet tab, and copy/paste code below. Assumes that Sale Price will always be in cell(1,"C"). Private Sub Worksheet_Change(ByVal Target As Range) On Error GoTo wsexit Application.EnableEvents = False If Target.Column = 2 Then Cells(Target.Row, 3).Value = Cells(1, "C") * Target.Value Else If Target.Column = 3 Then Cells(Target.Row, 2).Value = Target.Value / Cells(1, "C") End If End If wsexit: Application.EnableEvents = True End Sub "BRustigian" wrote: Hello, What formula will allow me to input a number % in (B 2) to find $25,000 or input a number $25,000 in (C 2) to find 10% in (B 2) without erasing the cell's formulas? A B C 1 Sales Price: $250,000 2 Down Payment: 10% 25,000. 3 1st Mortgage 80% 200,000. 4 2nd Mortgage 10% 25,000. -- BRustigian ------------------------------------------------------------------------ BRustigian's Profile: http://www.excelforum.com/member.php...fo&userid=4345 View this thread: http://www.excelforum.com/showthread...hreadid=566873 |
All times are GMT +1. The time now is 10:22 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com