Return variable as currency ?

WineSnob

Not Bright but TENACIOUS
Local time
Today, 13:19
Joined
Aug 9, 2010
Messages
211
Below is the code I have. I am trying to return SegInvestmentBucketStartValue as currency, but keep getting intergers?

Function fnSegmentBucketValues(nYear As Integer, SegROR As Double, pvAssets As Currency, PercAllocation As Double)
Dim I As Integer
Dim SegInvestmentBucketStartValue As Currency

For I = 1 To nYear
If I = 1 Then
SegInvestmentBucketStartValue = (pvAssets * PercAllocation) * (1 + SegROR) ^ 1
Else
SegInvestmentBucketStartValue = SegInvestmentBucketStartValue * (1 + SegROR)
End If

fnSegmentBucketValues = SegInvestmentBucketStartValue
Next I
End Function
 
Hi
You may like to try this.
Replace:
Code:
Function fnSegmentBucketValues(nYear As Integer, SegROR As Double, pvAssets As Currency, PercAllocation As Double)
With
Code:
Function fnSegmentBucketValues(nYear As Integer, SegROR As Double, pvAssets As Currency, PercAllocation As Double)
As Currency
 
SWEET .... That did it.
 

Users who are viewing this thread

Back
Top Bottom