The lines below get us the value of 3 for exponential 4. (^ ) Arithmetic Exponential: This operator is used to get the exponent of one value to another. The line below divides the value b by variable a and prints the reminder value in cell A1. This operator is used to get the reminder after dividing one value from another. (Mod) Arithmetic Remainder Operator in VBA: While most PLs use the % (modulus) for getting the remainder, in VBA we use the keyword Mod. The line below divides the value b by variable a and prints it on the Cell "A1". (/) Arithmetic Division: This operator is used dividing one value from another.
The below lines multiplies the values of the two variables and prints it on the Cell "A1". (*) Arithmetic multiplication: This operator is used for multiplying or getting product of two or more numbers or values of two or more variables. The line below subtracts the value of a from b and prints it in the Cell "A1". (-) Arithmetic Subtraction: This operator is used for subtracting one value from another value of variables. If both, a and b will have the string values then the + operator will work as a concatenation operator. This operator also works as a concatenation operator. The lines below sum ups the values of the two variables and prints it on the Cell "A1". (+) Arithmetic Addition: This operator is used for adding two or more numbers or values of two or more variables. In Excel VBA, these operators are used for doing calculations on variables and numbers. The arithmetic operators are the same operators that we are using since childhood to do simple calculations. In the above example, we first use the assignment operator "=" to assign value to variable "a" and then use the "=" operator to assign value of "a" to value of Range("A1"). We will talk about it later in this tutorial. It is also used as a comparison operator in VBA. We use this operator to assign values to variables in excel VBA. In VBA, it is used to assign values to variables. This is the first operator you are going to use in any programming language. Let us take a look at each type of Operator in Excel VBA.
There are five types of operators in any programming language, so in VBA For example, in the lines below lines =, +, >, & are operators. The signs and keywords we use to operate variable in VBA are called VBA Operators.