• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

VBA Operators

VBA uses a handful of simple operators and relations, the most common of which are shown in Table 10-5.

Table 10-5. VBA operators and relations

Type

Name

Symbol

Arithmetic operators

Addition

+

 

Subtraction

-

 

Multiplication

*

 

Division

/

 

Division with Integer result

\

 

Exponentiation

^

 

Modulo

Mod

   

String operator

Concatenation

&

   

Logical operators

AND

AND

 

OR

OR

 

NOT

NOT

   

Comparison relations

Equal

=

 

Less than

<

 

Greater than

>

 

Less than or equal to

<=

 

Greater than or equal to

>=

 

Not equal to

<>

The Mod operator returns the remainder after division. For example:

8 Mod 3

returns 2, since the remainder after dividing 8 by 3 is 2.

To illustrate string concatenation, the expression:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint