我记得素数是只能被1和它本身除的数,如是的话如下代码能够实现。
Private Sub Command1_Click()
For i = 1 To 100
For j = 2 To i - 1
If i Mod j = 0 Then
Exit For
End If
If j = i - 1 Then
Print i
End If
Next j
Next i
End Sub