Question: I am making a program with a lot of Textbox input which will be submitted later, and I would like to assign the Textbox Name as a Variable and use a loop to increment the name of the Text box from Texbox1 to Textbox 20 

```
Dim Y As Integer
Dim X As String
Dim I As Integer
For I = 1 To 20
X = "TextBox" & Y
X.Value = ""
Next I

```

Answer: 
I think you are looking for something like (Me is the name of the UserForm):

```
Dim x As String
Dim i As Integer
For i = 1 To 20
   x = Me.Controls("TextBox" & i).Value
Next i

```
Using an online source (<https://www.ozgrid.com/VBA/control-loop.htm>)

You can loop through them without having to add a variable name:

```
Private Sub UserForm_Initialize()
Dim cCont As control
For Each cCont In Me.Controls
    cCont.Value = "foo"
Next cCont
End Sub

```