I am trying to use the mod operator to return a decimal value. However, when I enter 12.6 mod 5 into my VBA code, the result is 3. I would expect the answer to be 2.6. I think that VB is forcing the result to be in the integer form. I have tried forcing the mod to output a decimal by using the following code: CDbl(12.6 mod 5). This code also output 3.
Any help would be greatly appreciated!
P.S. I am using the Option Explit mode.
Any help would be greatly appreciated!
P.S. I am using the Option Explit mode.