I've searched everywhere for this but I haven't found the answer. Should be an easy one for all you Excel pros out there.
Basically I got a financial model where I want to have a Macro that loops a certain action until a certain value that is specified with an input box is reached.
More specifically, I want this macro to add 1€ to the price of the output until the IRR of the project (which is automatically calculated in a different cell on the worksheet) is equal to or greater than the IRR specified by the user in the input box.
Cell explanations:
B69= B67+1
B67= sales price
B43= IRR calculated from current cashflows
When I run the text as it is, the loop just continues endlessly but I want it to only continue until the actual IRR is larger than the one the user enters.
Basically I got a financial model where I want to have a Macro that loops a certain action until a certain value that is specified with an input box is reached.
More specifically, I want this macro to add 1€ to the price of the output until the IRR of the project (which is automatically calculated in a different cell on the worksheet) is equal to or greater than the IRR specified by the user in the input box.
Code:
myIRR = InputBox("Enter your desired IRR")
Do
Range("B69").Select
Selection.Copy
Range("B67").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Loop Until Range("B43") > myIRR
Cell explanations:
B69= B67+1
B67= sales price
B43= IRR calculated from current cashflows
When I run the text as it is, the loop just continues endlessly but I want it to only continue until the actual IRR is larger than the one the user enters.