 # VBA Exp Function in Excel

VBA Exp function in Excel is categorizes as Math(Mathematical) & Trig function. This is a built-in Excel VBA Function. This function returns an exponential value for a specific number(e raised to a power x). The constant e value is approximately 2.718282. If x value is greater than 709.782712893, returns an error.

We use this function in Excel and VBA. This function we use in either procedure or function in a VBA editor window in Excel. We can use this VBA Exp Function in any number of times in any number of procedures or functions. In the following section we learn what is the syntax and parameters of the Exp function, where we can use this Exp Function and real-time exampleS in Excel VBA.

## Syntax of VBA Exp Function

The syntax of the Exp Function in VBA is

`Exp(Number)`

The Exp function returns e raised to a power x.

#### Parameters or Arguments:

The Exp function has one argument in Excel VBA.
where
Number:The Number is a required parameter. It represents a number or numeric value. We use this parameter to find exponential value.

### Where we can apply or use VBA Exp Function?

We can use this Exp Function in VBA MS Office 365, MS Excel 2016, MS Excel 2013, 2011, Excel 2010, Excel 2007, Excel 2003, Excel 2016 for Mac, Excel 2011 for Mac, Excel Online, Excel for iPhone, Excel for iPad, Excel for Android tablets and Excel for Android Mobiles.

### Example 1: Find an Exponential value(-3)

Here is a simple example of the VBA Abs function. This below example finds an exponential value(-3).

```'Find An Exponential value(-3)
Sub VBA_Exp_Function_Ex1()

'Variable declaration
Dim iValue As Integer
Dim dResult As Double

iValue = -3

dResult = Exp(iValue)

MsgBox "An Exponential value of -3 is : " & dResult, vbInformation, "VBA Exp Function"

End Sub
```

Output: Here is the screen shot of the first example output. ### Example 2: Find an Exponential value(0)

Here is a simple example of the VBA Abs function. This below example finds an exponential value(0).

```'Find An Exponential value(0)
Sub VBA_Exp_Function_Ex2()

'Variable declaration
Dim iValue As Integer
Dim dResult As Double

iValue = 0

dResult = Exp(iValue)

MsgBox "An Exponential value of 0 is : " & dResult, vbInformation, "VBA Exp Function"

End Sub
```

Output: Here is the screen shot of the second example output. ### Example 3: Find an Exponential value(3)

Here is a simple example of the VBA Abs function. This below example finds an exponential value(3).

```'Find An Exponential value(3)
Sub VBA_Exp_Function_Ex3()

'Variable declaration
Dim iValue As Integer
Dim dResult As Double

iValue = 3

dResult = Exp(iValue)

MsgBox "An Exponential value of 3 is : " & dResult, vbInformation, "VBA Exp Function"

End Sub
```

Output: Here is the screen shot of the third example output. ### Example 4: Find an Exponential value(6.5)

Here is a simple example of the VBA Abs function. This below example finds an exponential value(6.5).

```'Find An Exponential value(6.5)
Sub VBA_Exp_Function_Ex4()

'Variable declaration
Dim iValue As Double
Dim dResult As Double

iValue = 6.5

dResult = Exp(iValue)

MsgBox "An Exponential value of 6.5 is : " & dResult, vbInformation, "VBA Exp Function"

End Sub
```

Output: Here is the screen shot of the third example output. #### Instructions to Run VBA Macro Code or Procedure:

You can refer the following link for the step by step instructions.

Instructions to run VBA Macro Code

#### Other Useful Resources:

Click on the following links of the useful resources. These helps to learn and gain more knowledge.