Tech Support Guy banner
Status
Not open for further replies.

Solved: Mod function in Visual Basic

2 reading
24K views 3 replies 3 participants last post by  wolfworx  
#1 ·
I am programming a application in VB 6 (Sudoku Solver) and cannot seem to find a VB function like the MOD() function in Excel. I have bee able to create a work around using INT((Col / 3 - .001+INT(x / 3)) * 3) instead of MOD(x,3), but is there a VB function that does this that I have not been able to find?
 
#2 ·
VBA has a Mod function, and I know it's not the same language but I can't imagine a language not having a function to do modular division; since VBA and VB have the same roots, there has to be a Mod in VB. Search the help files for division remainder and see what you get.

Sorry this wasn't a more direct answer.

Actually, just now searching VBA's help, I guess VB uses Mod as an operator not a function. Try something like Int(x Mod 3), see if that doesn't work for you.

HTH

chris.

[edit]
Wee, my 500th post! I hope it's a useful one.
[/edit]
 
Status
Not open for further replies.
You have insufficient privileges to reply here.