## How to use the INT function [VBA]

The INT function removes the decimals if the numeric value is above 0 (zero) and returns a negative integer less than or equal to the given argument.

The image above demonstrates how the INT function works. The fractional part of a positive number is removed leaving only the positive integer, example: 10.9 => 10, however, a negative number, example -10.3 is converted to the negative integer that is less than or equal to the argument. -10.3 => -11.

### Excel Function VBA Syntax

Int ( *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 INT function behaves with different arguments.

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

## How to comment

How to add a formula to your comment<code>Insert your formula here.</code>

Convert less than and larger than signsUse 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 OscarYou can contact me through this contact form