Private Sub CommandButton1_Click()
Dim Nb As Integer, Tbx As Object
If Not IsNumeric(TextBox1) Or TextBox1 = "" Then Exit Sub
Nb = Int(TextBox1)
For i = 1 To Nb
Set Tbx = UserForm2.Controls.Add("forms.TextBox.1")
With Tbx
.Width = 50
.Height = 18
.Left = 20
.Top = 10 + ((i - 1) * 20)
Htot = .Top
End With
Next
With UserForm2
.Height = Htot + 50
.Show
End With
End Sub