第1个回答 2019-09-13
for…next循环如下:(在C盘根目录建立一个名字为1的文件夹,反复10次)Private Sub Command2_Click()
Dim i As Integer
For i = 1 To 10
Set
fso
=
CreateObject("Scripting.filesystemobject")
fso.CreateFolder
("c:\1")
Next
End Sub
第2个回答 推荐于2018-02-27
Private Sub Command1_Click()
Text1 = ""
Dim a()
k = InputBox("请输入上限")
For i = 1 To k
If i Mod 2 = 0 And i Mod 3 = 0 And i Mod 5 <> 0 Then
j = j + 1
ReDim Preserve a(j)
a(j) = i
End If
Next i
For i = 1 To j
Text1 = Text1 & a(i) & " "
Next i
End Sub本回答被提问者和网友采纳
第3个回答 2009-09-13
For i = 1 To k
If (i Mod 2 = 0 And i Mod 3 = 0 And i Mod 5 <> 0) Then
Debug.Print i
End If
Next i
第4个回答 2009-09-13
For i = 0 To 100
If (i Mod 2 = 0) And (i Mod 3 = 0) And (i Mod 5 <> 0) Then
MsgBox i
End If
Next i