百度吧,挺多的,这是第一个的
Private Sub Form_Load()
Dim i As Integer
Dim j As Integer
Me.Show
j = 0
For i = 3 To 100
If IsPrime(i) = True Then
j = j + 1
Me.Print i,
End If
If j Mod 4 = 0 Then
Me.Print
End If
Next
End Sub
Private Function IsPrime(intNum As Integer) As Boolean
Dim i As Integer
For i = 2 To intNum \ 2
If (intNum Mod i) = 0 Then
IsPrime = False
Exit Function
End If
Next
IsPrime = True