V
Vasant Nanavati
Hi Harlan:
Yep ... realized that later and fixed the function in another branch of the
thread. Now it reads:
Function IsPrime(Num As Long) As Boolean
Dim i As Long
If Num < 2 Or (Num <> 2 And Num Mod 2 = 0) Then Exit Function
For i = 3 To Sqr(Num) Step 2
If Num Mod i = 0 Then Exit Function
Next
IsPrime = True
End Function
Regards,
Vasant.
Yep ... realized that later and fixed the function in another branch of the
thread. Now it reads:
Function IsPrime(Num As Long) As Boolean
Dim i As Long
If Num < 2 Or (Num <> 2 And Num Mod 2 = 0) Then Exit Function
For i = 3 To Sqr(Num) Step 2
If Num Mod i = 0 Then Exit Function
Next
IsPrime = True
End Function
Regards,
Vasant.