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 表示。 所有参数都必须是正数。

适用于

另请参阅