The VBA SYD function is listed under the financial category of VBA functions. When you use it in a VBA code, it calculates the sum-of-years digits depreciation for a specified period of time in the lifetime of an asset.
SYD (Cost, Salvage, Life, Period)
- Cost: The initial cost of the asset.
- Salvage: The value of the asset at the end.
- Life: The number of periods over which the asset is to be depreciated.
- Period: The period for which you want to calculate the depreciation.
To practically understand how to use VBA SYD function, you need to go through the below example where we have written a vba code by using it:
In the above code, we have used SYD to calculate the sum-of-years-digits method for the first year out of the 5 years of the asset’s life and it has returned 29333 in the result.
- If the salvage value is < 0, life or period ≤ 0, or period > life the VBA will return a run-time 5 error.