1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
Sub test()
'ici, j'ai typé en Double ?
Dim rnd() As Double
Dim WACC As Double
Dim RG As Double
Dim MBE As Double
Dim CA As Double
Dim CAPEXRev As Double
Randomize
With Application.WorksheetFunction
WACC = .NormInv(rnd(), Sheets("Parameters").Range("E18").Value, Userform1.a.Value())
RG = .NormInv(rnd(), Sheets("Parameters").Range("E19").Value, Userform1.b.Value())
MBE = .NormInv(rnd(), Sheets("Parameters").Range("E20").Value, Userform1.c.Value())
CA = .NormInv(rnd(), Sheets("Parameters").Range("E21").Value, Userform1.d.Value())
CAPEXRev = .NormInv(rnd(), Sheets("Parameters").Range("E22").Value, Userform1.e.Value())
End With
MsgBox DCF(WACC, _
RG, _
MBE, _
CA, _
CAPEXRev)
End Sub
Function DCF(WACC As Double, _
RG As Double, _
MBE As Double, _
CA As Double, _
CAPEXRev As Double)
Dim FCF As Double
FCF = MBE * CA * 0.67 - CAPEXRev * CA
DCF = FCF / (WACC - RG)
End Function |
Partager