SLN 函數

回傳一個雙 重 值,指定資產在單一期間的直線折舊。

語法

SLN (成本、打撈、生命)

SLN 函式具有以下命名參數:

部分 描述
成本 此為必要動作。 雙重 指定資產的初始成本。
打撈 此為必要動作。 雙重 指定資產在其使用壽命結束時的價值。
生平 此為必要動作。 雙重 指定資產的使用壽命長度。

註解

折舊期間必須與 生命週期論點相同的單位表示。 所有參數必須為正數。

範例

此範例使用 SLN 函數,根據資產初始成本 () 、資產使用壽命結束時的殘值) InitCost (SalvageVal ,以及資產總生命週期( () LifeTime 年)計算,回傳單一期間的直線折舊結果。

Dim Fmt, InitCost, SalvageVal, MonthLife, LifeTime, PDepr
Const YEARMONTHS = 12    ' Number of months in a year.
Fmt = "###,##0.00"    ' Define money format.
InitCost = InputBox("What's the initial cost of the asset?")
SalvageVal = InputBox("What's the asset's value at the end of its useful life?")
MonthLife = InputBox("What's the asset's useful life in months?")
Do While MonthLife < YEARMONTHS    ' Ensure period is >= 1 year.
    MsgBox "Asset life must be a year or more."
    MonthLife = InputBox("What's the asset's useful life in months?")
Loop
LifeTime = MonthLife / YEARMONTHS    ' Convert months to years.
If LifeTime <> Int(MonthLife / YEARMONTHS) Then
    LifeTime = Int(LifeTime + 1)    ' Round up to nearest year.
End If
PDepr = SLN(InitCost, SalvageVal, LifeTime)
MsgBox "The depreciation is " & Format(PDepr, Fmt) & " per year."

另請參閱

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。