Quantcast
Channel: Excel IT Pro Discussions forum
Viewing all articles
Browse latest Browse all 11829

Worksheet Functions not Supported by Application Object, VBA Mod is not the same as Excel Mod

$
0
0

kb article 107564 states that VBA Mod function is the same as excel Mod funciton.

and as a result of this the Excel Mod function is not available in VBA.

The vba help provides examples and specificaly states that the mod is rounded to an integer:

Dim MyResult
MyResult = 10 Mod 5    ' Returns 0.
MyResult = 10 Mod 3    ' Returns 1.
MyResult = 12 Mod 4.3    ' Returns 0.
MyResult = 12.6 Mod 5    ' Returns 3.

However using excel Mod(x,y) function: these results occur:

Mod(10,5) = 0
Mod(10,3) = 1
Mod(12,4.3) = 3.4
Mod(12.6,5) = 2.6

This is from Excel 2010.

How can we get the Application to use the Excel Worksheet function?



Viewing all articles
Browse latest Browse all 11829

Trending Articles