Module
Contents
Index 🔎︎

# NPer Function [VBA]

Calculates the number of periods for a loan or investment.

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

## 语法：

    NPer (Rate as Double, Pmt as Double, PV as Double, [FV as Variant], [Due as Variant])

## 返回值：

Double

## 参数：

Rate is the periodic interest rate.

Pmt is the annuity paid regularly per period.

PV is the (present) cash value of an investment.

FV (optional) is the future value of the loan / investment.

Due (optional) defines whether the payment is due at the beginning or the end of a period.

0 - the payment is due at the end of the period;

1 - the payment is due at the beginning of the period.

## 错误代码：

5 无效的过程调用

## 示例：

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

    Option VBASupport 1

    Sub ExampleNPer

     Dim period As Double

     period = NPer( 0.06, 153.75, 2600)

     Print period ' returns -12,02. The payment period covers 12.02 periods.

    End Sub

相关主题

NPER function in CALC

VBA 财务函数