[此贴子已经被作者于2016-8-3 10:43编辑过]
Private Sub Command1_Click() Dim i As Integer Dim a As Double For i = 0 To Text1.UBound If Val(Text1(i).Text) <> 0 Then '养成书写控件属性的习惯 a = a + Val(Text1(i).Text) End If 'IF 语句必须有结束语句 Next i '循环必须有出口 End Sub