Search notes:

VBA operators

VBA has two kinds of operators:

and

The and operator can be used to check whether a specific bit is set
option explicit

sub main()

    dim num as integer

    for num = 0 to 17

        if num and 4 then
           debug.print format$(num, "@@") & " : bit 4 set"
        else
           debug.print format$(num, "@@") & " : bit 4 not set"
        end if

    next num

end sub
Github repository about-VBA, path: /language/operators/and.bas

addressOf

The addressOf operator evaluates to the address of the name of the sub/function that follows it.
It is usually used for Win API callbacks.

like

like allows to perform text-pattern matching. It is still far from regular expressions.

Other operators

-
&
*
/
\
^
+
=
arithmetic
comparison
concatenation
eqv
imp
is
logical
mod
new
not
or
xor

See also

VBA.

Index