Office tutorials

Fix VBA function – How to round negative numbers up

1. Fix VBA function – Description

The Fix VBA function is used to round numbers, that have decimal places to integers. The Fix function, in comparision to the Round function, does not require entering additional arguments. The result will always be an integer. Important information is, that for negative numbers, the VBA Fix function rounds the number up to zero. If you want to round the negative number down (further from zero value), you should use the VBA Int function.

2. VBA Fix function – Syntax

Number: The number that you want to round.

Function return: Number / integer value.

3. VBA Fix function – Example

How to use the Fix  function in VBA Excel? Examples of using the Fix function in the VisualBasic Editor are listed below.

Example 1: Example of using the Fix VBA function – result in the MsgBox window.

Example 2: VBA Fix – example of a function – result in an Excel spreadsheet.

VBA Excel functions - Fix VBA function

VBA Excel functions – Fix VBA function

4. VB Fix function – Additional information

  • Fix function not require additional arguments.
  • For negative numbers, the function rounds number up.

5. Fix VisualBasic function – Where to use?

The function can be used in: Excel 2003, Excel 2007, Excel 2010, Excel 2013, Excel 2016.

The article is part of the list of VBA Excel functions. A list of all VBA functions can be found at this address: Excel VBA functions.

Leave a Reply

Your email address will not be published.