Search
Close this search box.

VBA Introduction


Arithmetic Operators: Arithmetic operators in computer science are symbols or functions that execute mathematical operations including addition, subtraction, multiplication, division, and exponentiation. These operations allows manipulation and calculation of numbers

Addition (+): Adds two numbers.
				
					Sub equalto_demo()
    Dim sum As Integer
    sum = 10 + 20
End Sub
				
			

Example

				
					Sub notequalto_demo()
    Dim difference As Integer
    difference = 20 - 10
End Sub
				
			

Example

				
					Sub lessthan_demo()
    Dim product As Integer
    product = 5 * 4
End Sub
				
			

Example

				
					Sub lessthan_demo()
    Dim quotient As Double
    quotient = 10 / 2
End Sub
				
			

Example

				
					Sub lessthan_demo()
    Dim result As Integer
    result = 10 \ 3 ' Result will be 3
End Sub
				
			

Example

				
					Sub Mod_demo()
    Dim remainder As Integer
    remainder = 10 Mod 3 ' Result will be 1
End Sub
				
			

Example

				
					Sub Raises_number_demo()
    im power As Double
    power = 2 ^ 3 ' Result will be 8
End Sub
				
			

Example