This might be more efficient
For i = 3 To Int(Sqr(num)) Step 2
Just be aware that 20% of the time your 'i' value ends in 5.
Numbers that end in 5, ie 25, 35,45, etc are also divisible by 5.
Hence, checking 5's is a waste. However, the time involved getting around
this is probably not worth it.
It's too bad Microsoft refuses to fix the MOD bug with Excel, even in xl
2007.
One is still limited in vba to the number 2147483647 !!
Sure wish Microsoft would fix this. It would make a lot of code easier to
write.
Sub Demo()
On Error Resume Next
Debug.Print 2147483647# Mod 2 'Ok
Debug.Print 2147483648# Mod 2 '(Error Limit!)
'// Can't do this of course
Debug.Print 268435455999# Mod 2000
'// Worksheet MOD is a little different:
'// As the number on Right increases, the number of Left
'// can be made larger
'// Ok, Limit...
Debug.Print [MOD(268435455999,2000)]
'// Error if +1
Debug.Print [MOD(268435456000,2000)]
End Sub