SLN 函数

返回一个 Double,它指定单个周期的资产的线性折旧额。

语法

SLN (成本打捞生命)

SLN 函数具有以下命名参数

Part 说明
成本 必填。 用于指定资产的原始成本的 Double
打捞 必填。 用于指定资产在其使用年限结束时的价值的 Double
生活 必填。 用于指定资产的使用年限的长度的 Double

备注

折旧周期必须用 与 life参数相同的单位表示。 所有参数都必须是正数。

示例

此示例使用 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 支持和反馈,获取有关如何接收支持和提供反馈的指南。