What is VBA SYD Function
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.
how to use it
To use VBA's SYD function you need to understand its syntax and arguments:
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.
Example to use SYD Function in VBA
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.
Below are some important points which you need to take care while using SYD function in VBA.
- If the salvage value is < 0, life or period ≤ 0, or period > life the VBA will return a run-time 5 error.
About the Author
Puneet is using Excel since his college days. He helped thousands of people to understand the power of the spreadsheets and learn Microsoft Excel. You can ﬁnd him online, tweeting about Excel, on a running track, or sometimes hiking up a mountain.