一、文本框是控件数组
Dim i As Long
For i = 0 To Text1.Count - 1
Text1(i).Text = i
Next i
二、文本框不是控件数组
Dim i As Long
For i = 0 To Form1.Controls.Count - 1
'If Form1.Controls(i).Name = "Text1" Then
'按名字
If TypeName(Form1.Controls(i)) = "TextBox" Then
'按类型
Form1.Controls(i).Text = i + 1
End If
Next i