I am using excel 2000 and needed a mod function to return the mod number rather than 0. ex 3 mod 3 is normally 0, but I want it to return 3. So I wrote this function
it seems to work, but when I call it with this stmt
with x=1,y=3; the y somehow becomes 0 when I try to set that member of possible to 0. I am stumped. any suggestions?
Code:
Function Modulus(a, b) As Integer 'for x,y positive
Do While a > b
a = a - b
Loop
Modulus = a
End Function
it seems to work, but when I call it with this stmt
Code:
If Ceiling(i / 3) = Ceiling(x / 3) And Ceiling(j / 3) = Ceiling(y / 3) Then
If Cells(x, y) <> 0 Then
Possible((Modulus(x, 3) - 1) * 3+ Modulus(y, 3)) = 0
End If
End If
with x=1,y=3; the y somehow becomes 0 when I try to set that member of possible to 0. I am stumped. any suggestions?