我想要这样做是否有办法:
textbox1.text = x + i
textbox2.text = x + i
textbox3.text = x + i
像这样做?
for l = 0 to 2
textbox(l) = x + i
next
答案 0 :(得分:6)
假设这些控件位于用户窗体内,请执行以下操作:
Private Sub FillTextboxes()
Dim i As Long
Dim x As Long
x = 10
For i = 0 To 2
Me.Controls("textbox" & i + 1).Text = x + i
Next i
End Sub