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 論點相同的單位表示。 所有參數必須為正數。

適用於

另請參閱