Financial.SLN(Double, Double, Double) 方法

定义

返回一个值,该值指定资产在一个周期内的直线折旧。

public:
 static double SLN(double Cost, double Salvage, double Life);
public static double SLN (double Cost, double Salvage, double Life);
static member SLN : double * double * double -> double
Public Function SLN (Cost As Double, Salvage As Double, Life As Double) As Double

参数

Cost
Double

必需。 资产的原始成本。

Salvage
Double

必需。 资产在使用年限结束时的价值。

Life
Double

必需。 资产的使用年限。

返回

资产在一个周期内的直线折旧。

例外

Life = 0.

示例

此示例使用 SLN 函数返回资产在单个时间段的直线折旧值,给定资产的初始成本 () InitCost 、资产使用年限结束时的残值 (SalvageVal) ,以及资产的总寿命(以年为单位) (LifeTime) 。

Dim InitCost, SalvageVal, LifeTime, DepYear As Double
Dim Fmt As String = "###,##0.00"

InitCost = CDbl(InputBox("What's the initial cost of the asset?"))
SalvageVal = CDbl(InputBox("Enter the asset's value at end of its life."))
LifeTime = CDbl(InputBox("What's the asset's useful life in years?"))

' Use the SLN function to calculate the deprecation per year.
Dim SlnDepr As Double = SLN(InitCost, SalvageVal, LifeTime)
Dim msg As String = "The depreciation per year: " & Format(SlnDepr, Fmt)
msg &= vbCrLf & "Year" & vbTab & "Linear" & vbTab & "Doubling" & vbCrLf

' Use the SYD and DDB functions to calculate the deprecation for each year.
For DepYear = 1 To LifeTime
    msg &= DepYear & vbTab & 
        Format(SYD(InitCost, SalvageVal, LifeTime, DepYear), Fmt) & vbTab & 
        Format(DDB(InitCost, SalvageVal, LifeTime, DepYear), Fmt) & vbCrLf
Next
MsgBox(msg)

注解

折旧期间必须用与 参数相同的单位 Life 表示。 所有参数都必须是正数。

适用于

另请参阅