附註: 我們想要以您的語言,用最快的速度為您提供最新的說明內容。本頁面是經由自動翻譯而成,因此文中可能有文法錯誤或不準確之處。讓這些內容對您有所幫助是我們的目的。希望您能在本頁底部告訴我們這項資訊是否有幫助。此為英文文章出處,以供參考。
傳回 Double,指定期資產的直線折舊。
語法
SLN ( 成本、 殘餘生活 )
SLN函數具有下列引數:
引數 |
描述 |
成本 |
所需。雙指定資產的原始成本。 |
殘餘 |
所需。Double,指定在其生命週期結尾資產的值。 |
生活 |
所需。雙指定資產的生命週期的長度。 |
註解
折舊期間必須生活引數為相同的單位表示。所有引數必須是正數。
範例
附註: 下列範例示範如何在 Visual Basic for Applications (VBA) 模組中使用此函數。 如需使用 VBA 的詳細資訊,請在 [搜尋] 旁的下拉式清單中選取 [開發人員參考],並在 [搜尋] 方塊中輸入一個或多個字詞。
此範例使用SLN函數傳回資產的原始成本 (InitCost),結尾的資產的生命週期 (SalvageVal) 和 total 生命週期的殘餘價值單一期間內的資產直線折舊以年 (LifeTime) 的資產。
Dim Fmt, InitCost, SalvageVal
Dim 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?")
' Ensure period is >= 1 year.
Do While MonthLife < YEARMONTHS
MsgBox "Asset life must be a year or more."
MonthLife = InputBox("What's the asset's " & _
"useful life in months?")
Loop
' Convert months to years.
LifeTime = MonthLife / YEARMONTHS
If LifeTime <> Int(MonthLife / YEARMONTHS) Then
' Round up to nearest year.
LifeTime = Int(LifeTime + 1)
End If
PDepr = SLN(InitCost, SalvageVal, LifeTime)
MsgBox "The depreciation is " & _
Format(PDepr, Fmt) & " per year."