Return to VBA Code Examples

VBA Round Function

Round Function

Returns a number rounded to a specified number of digits.

Simple Round Examples

This will return 5.4

Round Syntax

In the VBA Editor, you can type  “Round(” to see the syntax for the Round Function:

The Round function contains 2 arguments:

Number: Any valid numeric expression.

NumDigitsAfterDecimal: [Optional] Number indicating how many places to the right of the decimal are included in the rounding (0 if ommitted)

Examples of Excel VBA Round Function

Result: 2

Result: 2.5

Result: 3

Result: 2.5

Result: 2.546

VBA Coding Made Easy

Stop searching for VBA code online. Learn more about AutoMacro - A VBA Code Builder that allows beginners to code procedures from scratch with minimal coding knowledge and with many time-saving features for all users! vba save as

Learn More!