让我这个新手来解决下
Private Sub Form_Load()
Dim Num1 As Long '第一个数字
Dim Num2 As Long '第二个数字
Dim Temp As String '临时保存素数的
Num1 = Int(Text1.Text): Num2 = Int(Text2.Text) '把输入的两个数加进来
For i = Num1 To Num2
For j = 2 To i - 1
If Int(i / j) = i / j Then Exit For
Next
If j = i Then
Sum = Sum + 1
Temp = j & ","
With Text3 '用一个文本框显示出素数
.SelStart = Len(.Text)
.SelText = Temp
End With
End If
Next
MsgBox "两个数之间的素数个数为" & Sum & "个"
End Sub