VBA Arithmetic and ORDER of Operations

It's no secret programming in any language involves some level of math. Though it's not necessary to be a mathematical wiz in calculus, algebra or trigonometry, it is useful to understand the essential arithmetic operators and order of precedence offered in a given programming language. For basic mathematical operations, VBA supports the operators seen in Table 2.4.

Table 2.4 Common Mathematical Operators

Operator Purpose Example Result

- Subtraction iPoints = 100 - 20 80

* Multiplication dResult = 5 * 213.78 1068.9

A Exponentiation iResult = 2 A 3 8

0 0

Post a comment