[vba] What operator is <> in VBA

I was studying some code and came across this:

If DblBalance <> 0 Then

I can't figure out what operator this is, any help would be appreciated.

This question is related to vba operators

The answer is


In VBA this is <> (Not equal to) operator.

The result becomes true if expression1 <> expression2

The result becomes false if expression1 = expression2

Additional Reading 1

Additional Reading 2


in sql... we use it for "not equals"... I am guessing, its the same in VB aswell.


It is an "INEQUALITY" operator. Get a list of comparison operators in VBA


This is an Inequality operator.

Also,this might be helpful for future: Operators listed by Functionality


Not Equal To


Before C came along and popularized !=, languages tended to use <> for not equal to.

At least, the various dialects of Basic did, and they predate C.

An even older and more unusual case is Fortran, which uses .NE., as in X .NE. Y.


It means not equal to, as the others said..

I just wanted to say that I read that as "greater than or lesser than".

e.g.

let x = 12

if x <> 0 then
    //code

In this case 'x' is greater than (that's the '>' symbol) 0.

Hope this helps. :D