Financial.SLN(Double, Double, Double) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
傳回值,指定資產在單一期間內的直線折舊。
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
與 自變數相同的單位表示。 所有自變數都必須是正數。