# Round VBA function – How to round a number

## 1. Round VBA Function – Description

The Round VBA function is used to round numbers with decimal places. How can I use the Round function? In place of the first argument of the function, enter the number you want to round. In place of the second argument, enter the number of decimal places to which you want to round the number. If you want to return a value with no decimal places, do not enter the second argument of the function. The result will be an integer. We can also obtain an integer after using the VBA Fix or VBA Int functions .

## 2. VBA Round function – Syntax

```'OfficeInside.Org
Round(Number, [NumDigitsAfterDecimal As Long]) ```

Number : The number we want to round.

NumDigitsAfterDecimal : Optional argument. The number of decimal places to which we want to round the number.

Function return : Numeric value.

## 3. VBA Round function – Example

How to use Round function in VBA Excel? Below is an example of using the Round function in the VisualBasic Editor.

Example 1 : Rounding a Number Round Function. The result in the MsgBox window and the sheet cell.

```'OfficeInside.Org
Sub RoundFunctionExample()
MsgBox Round(5.123)
MsgBox Round(987.123456, 2)
Range("A1") = Round(3.141234, 3)
MsgBox Round(Range("a1"), 2)
End Sub```