0
我的代码如下所示来计算dimishing平衡法折旧:如何使用VBA的Excel
Function Depreciation(pCost As Currency, Age As Double)
Dim cValue As Currency
Dim Dep As Double
Select Case Age
Case Is < 1
Dep = pCost
cValue = pCost - Dep
Depreciation = cValue
Case Is < 2
Dim cValue1 As Currency
Depreciation = cValue * 0.25
cValue1 = cValue - Depreciation
Depreciation = cValue1
Case Is < 3
Dim cValue2 As Currency
Depreciation = cValue1 * 0.25
cValue2 = cValue1 - Depreciation
Depreciation = cValue2
End Select
End Function