Private Function IsPrime(Num As Integer) As Boolean
Dim tmp As Boolean
Dim i As Integer
tmp = True
For i = 2 To Sqr(Num)
If Num Mod i Then
Else
tmp = False
Exit For
End If
Next
IsPrime = tmp
End Function