WorksheetFunction.Round (Excel)

Rounds a number to a specified number of digits.

If num_digits is greater than 0 (zero), number is rounded to the specified number of decimal places. If num_digits is 0, number is rounded to the nearest integer. If num_digits is less than 0, number is rounded to the left of the decimal point.

Round (Arg1, Arg2)


Dim dblArg1 As Double: dblArg1 = 
Dim dblArg2 As Double: dblArg2 = 
Dim dblRounded As Double
dblRounded = WorksheetFunction.Round(Arg1:=dblArg1, Arg2:=dblArg2)

Arguments

Arg1, Arg2

Arg1 (Double) - Number - the number that you want to round.

Arg2 (Double) - Num_digits - specifies the number of digits to which you want to round number.