VBA SYD Function (Syntax + Example)

Last Updated: June 22, 2023
puneet-gogia-excel-champs

- Written by Puneet

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.

Syntax

SYD (Cost, Salvage, Life, Period)

Arguments

  • 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 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:

example-vba-syd-function

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.

Notes

  • If the salvage value is < 0, life or period ≤ 0, or period > life the VBA will return a run-time 5 error.