新建From1(窗体),新建Command1(按钮CommandButton),代码:
Private Sub Command1_Click() Dim i As Integer For i = 0 To 5 Next Debug.Print i End Sub
运行结果:
6