Mod Operator

You can find the remainder in Integer division by using the modulus operator (mod)
The Mod operator returns the remainder after division.
This is similar to the integer division except it only returns the remainder.


Even Numbers


Odd Numbers


Loops

This is extremely useful when you have a loop and you want to perform an action every nth times through a loop.


Maths Formula

This is actually equivalent to the following maths formula


Very Large Numbers

You can also get overflow errors in VBA using the Mod operator with very large numbers. For example,


© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext