The VBA SLN function calculates the straight line depreciation of an asset for a single period.
The syntax of the function is:
Where the function arguments are:
|Salvage||-||The value of the asset at the end of its useful life.|
|Life||-||The number of periods over which the asset is to be depreciated.|
' Calculate the yearly depreciation of an asset that cost $10,000 atDim yrly_dep As Double
' the start of year 1, and has a salvage value of $1,000 after 5 years.
yrly_dep = SLN( 10000, 1000, 5 )
' yrly_dep is calculated to be 1800.
The above call to the VBA SLN function calculates the yearly depreciation of the asset to be $1,800.
Therefore, as expected, the total depreciation of the asset over 5 years is $9,000.
If the supplied Life argument is equal to 0, the VBA SLN produces the error: