## How to use the FIX function [VBA]

The FIX function removes the decimals from the argument.

### Excel Function VBA Syntax

Fix(*number*)

### Arguments

number |
Required. Is a Double or any valid numeric expression. If number is 0 (zero) then 0 (zero) is returned. |

### Comments

I used the following macro to show how the Fix function behaves with different arguments.

Sub Macro1() For Each cell In Range("B3:B12") cell.Offset(, 1) = Fix(cell.Value) Next cell End Sub

### Formula equation

Fix(number) = Sgn(number) * Int(Abs(number))

How to use the JOIN function [VBA]

The JOIN function concatenates a set of substrings in an array, the image shows a user-defined function entered in cell […]

How to use the LBOUND and UBOUND functions

The Lbound and Ubound functions calculate the size of of an array. The Lbound returns the lower limit of an array and […]

How to use the ARRAY function [VBA]

The ARRAY function creates a Variant variable containing array values. The macro above populates variable MyArray with values Cat, Dog […]

How to use the SPLIT function [VBA]

The picture above shows a user-defined function (UDF) that splits the string in cell B3 using delimiting character "|". The SPLIT function […]

### 2 Responses to “How to use the FIX function [VBA]”

### Leave a Reply

### How to comment

**How to add a formula to your comment**

<code>Insert your formula here.</code>

**Convert less than and larger than signs**

Use html character entities instead of less than and larger than signs.

< becomes < and > becomes >

**How to add VBA code to your comment**

[vb 1="vbnet" language=","]

Put your VBA code here.

[/vb]

**How to add a picture to your comment:**

Upload picture to postimage.org or imgur

Paste image link to your comment.

**Contact Oscar**

You can contact me through this contact form

In Office 365 it is a function named FIXED who do same things.

No. That is no true

If first digit of decimals are >= 5, rezult of FIXED is number + 1

24.5 -> =FIXED(24.5,0,0)=25

-148.69 -> =FIXED(-148.69,0,0)=-149