Module
Contents
Index 🔎︎

# SLN Function [VBA]

Returns the straight-line depreciation of an asset for one period. The amount of the depreciation is constant during the depreciation period.

该功能或常量可通过以下语句启用：Option VBASupport 1，该语句需要放置在模块的每个可执行程序代码的前面。

## 语法：

    SLN (Cost as Double, Salvage as Double, Life as Double)

## 返回值：

Double

## 参数：

Cost is the initial cost of an asset.

Salvage is the value of an asset at the end of the depreciation.

Life is the depreciation period determining the number of periods in the depreciation of the asset.

## 错误代码：

5 无效的过程调用

## 示例：

    REM ***** BASIC *****

    Option VBASupport 1

    Sub ExampleSLN

    REM Calculate the yearly depreciation of an asset that cost $10,000 at

    REM the start of year 1, and has a salvage value of $1,000 after 5 years.

    Dim y_dep As Double

    y_dep = SLN( 10000, 1000, 6 )

    print y_dep ' returns 1500.

    End Sub

相关主题

SLN function in CALC

VBA 财务函数