Private Sub Command1_Click()
Dim Counter As Long
Dim Value As Long
Dim Results As Boolean
Value = Abs(Val(Me.Text1.Text))
Results = True
For Counter = 2 To Value - 1
If Value Mod Counter = 0 Then
Results = False
Exit For
End If
Next Counter
MsgBox "Prime Number Is " & Results
End Sub