Private Sub Command1_Click()
Dim i As Integer
For i = 1 To 1000
If ss(i) Then
Print i;
k = k + 1
If k Mod 10 = 0 Then Print
End If
Next i
Print: Print
End Sub
Function ss(x As Integer) As Boolean
ss = False
For i = 2 To Sqr(x)
If x Mod i = 0 Then Exit Function
Next i
ss = x > 1
End Function