I am looking for help on setting up a VBA code for a CHANGE EVENT when a cell is entered and VBA kick in.
For Example I have B4 as “Initial Loan amount”, and D4 as “LTV %”. (Example pasted at the bottom of this message)
Purchase price is D1. For this example it’s $6,000,000.
Now going back to the two cells. If I enter 65% in the LTV cell D4, the Initial Loan cell B4 will state $3,900,000 (65% of $6,000,000). But if I change my mind and want to delete both cell, or just replace/overwrite the Initial Loan number for example to $2,100,000, then the LTV cell will automatically update/change to 35%. And if I wanted to go the LTV cell and change it to 60%, the Initial Loan cell will update to $3,600,000.
I am hoping you can help with a VBA code.
I will have 5 Loan rows.
Would like the CHANGE EVENT VBA to work for the following cell.
B4 with D4 (Loan 1)
B5 with D5 (Loan 2)
B6 with D6 (Loan 3)
B7 with D7 (Loan 4)
B8 with D8 (Loan 5)
Thanks,
[TABLE="width: 374"]
<colgroup><col><col><col><col><col span="2"></colgroup><tbody>[TR]
[TD][/TD]
[TD]Loan Amount[/TD]
[TD][/TD]
[TD] 6,000,000[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Initial Loan[/TD]
[TD][/TD]
[TD]LTV[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Loan 1[/TD]
[TD] 3,900,000[/TD]
[TD][/TD]
[TD="align: right"]65.0%[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Loan 2[/TD]
[TD] [/TD]
[TD][/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Loan 3[/TD]
[TD] [/TD]
[TD][/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Loan 4[/TD]
[TD] [/TD]
[TD][/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Loan 5[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Total[/TD]
[TD] 3,900,000[/TD]
[TD][/TD]
[TD="align: right"]65.0%[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Loan 1[/TD]
[TD] =D4*D1 [/TD]
[TD][/TD]
[TD]=B4/D1[/TD]
[TD="colspan: 2"]Looking for VBA Change Event code[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
For Example I have B4 as “Initial Loan amount”, and D4 as “LTV %”. (Example pasted at the bottom of this message)
Purchase price is D1. For this example it’s $6,000,000.
Now going back to the two cells. If I enter 65% in the LTV cell D4, the Initial Loan cell B4 will state $3,900,000 (65% of $6,000,000). But if I change my mind and want to delete both cell, or just replace/overwrite the Initial Loan number for example to $2,100,000, then the LTV cell will automatically update/change to 35%. And if I wanted to go the LTV cell and change it to 60%, the Initial Loan cell will update to $3,600,000.
I am hoping you can help with a VBA code.
I will have 5 Loan rows.
Would like the CHANGE EVENT VBA to work for the following cell.
B4 with D4 (Loan 1)
B5 with D5 (Loan 2)
B6 with D6 (Loan 3)
B7 with D7 (Loan 4)
B8 with D8 (Loan 5)
Thanks,
[TABLE="width: 374"]
<colgroup><col><col><col><col><col span="2"></colgroup><tbody>[TR]
[TD][/TD]
[TD]Loan Amount[/TD]
[TD][/TD]
[TD] 6,000,000[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Initial Loan[/TD]
[TD][/TD]
[TD]LTV[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Loan 1[/TD]
[TD] 3,900,000[/TD]
[TD][/TD]
[TD="align: right"]65.0%[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Loan 2[/TD]
[TD] [/TD]
[TD][/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Loan 3[/TD]
[TD] [/TD]
[TD][/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Loan 4[/TD]
[TD] [/TD]
[TD][/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Loan 5[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Total[/TD]
[TD] 3,900,000[/TD]
[TD][/TD]
[TD="align: right"]65.0%[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Loan 1[/TD]
[TD] =D4*D1 [/TD]
[TD][/TD]
[TD]=B4/D1[/TD]
[TD="colspan: 2"]Looking for VBA Change Event code[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]