(点击命令按钮)
excel vba:
Private Sub CommandButton1_Click()
Dim i,a As Integer
For i = 1 To 9
a = i * i
Cells(i, 10) = a
Next i
End Sub
vb:
Private Sub CommandButton1_Click()
Dim i,a As Integer
For i = 1 To 9
a = i * i
print a
Next i
End Sub
print 打印到哪里去了。应该在窗体左上角