Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VBA equivalent to Excel's mod function

Is there a vba equivalent to excel's mod function?

like image 672
Arlen Beiler Avatar asked Dec 07 '10 14:12

Arlen Beiler


People also ask

Is there a MOD function in VBA?

The MOD function is a built-in function in Excel that is categorized as a Math/Trig Function. It can be used as a VBA function (VBA) in Excel. As a VBA function, you can use this function in macro code that is entered through the Microsoft Visual Basic Editor.

What is modulus in VBA?

VBA Mod is not a function, in fact, it is an operation which is used for calculating the remainder digit by dividing a number with divisor. In simple words, it gives us the remainder value, which is the remained left part of Number which could not get divided completely.

How do you do a while loop in VBA?

While loop is used when we want to repeat a set of statements as long as the condition is true. The condition may be checked at the beginning of the loop or at the end of the loop.

How do you round off in Excel VBA?

By using the RoundUp function. In other words, it rounds the number away from zero. Being an inbuilt function of Excel, it accepts two arguments–the “number” and the “num_of _digits.” For example, “=ROUNDUP(0.40,1)” returns 0.4.


1 Answers

In vba the function is MOD. e.g

 5 MOD 2 

Here is a useful link.

like image 172
Vincent Ramdhanie Avatar answered Oct 12 '22 02:10

Vincent Ramdhanie