I need some help with a relatively simply piece of VBA code.
Basically I'm working on a financial model with certian inputs and outputs.
Currently the NPV of the project is negative but I want to create a Macro that keeps adding 1€ to the price of the output until the NPV is above 0.
However the code I've got now just keeps looping endlessly and doesn't stop when the NPV reaches a positive value.
This is my code:
Sub Macro1()
'
' Macro1 Macro
' Increases price until NPV is positive'
'
Do
Range("F67").Select
Selection.Copy
Range("B67").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Loop Until B43 > 0
End Sub
Explanations:
B67= Price that feeds into the model
F67= B67+1
B43= NPV
What am I doing wrong?
Basically I'm working on a financial model with certian inputs and outputs.
Currently the NPV of the project is negative but I want to create a Macro that keeps adding 1€ to the price of the output until the NPV is above 0.
However the code I've got now just keeps looping endlessly and doesn't stop when the NPV reaches a positive value.
This is my code:
Sub Macro1()
'
' Macro1 Macro
' Increases price until NPV is positive'
'
Do
Range("F67").Select
Selection.Copy
Range("B67").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Loop Until B43 > 0
End Sub
Explanations:
B67= Price that feeds into the model
F67= B67+1
B43= NPV
What am I doing wrong?