jeelpuranik
02-02-2021, 10:06 AM
Hello Everyone,
I am actually working on a project and i need help with something.
I have to create multiple textbox dynamically and ask user to enter some values in that field and then use that value in my module(where i have written rest of the code for the program)
So i have successfully managed to dynamically create textbox as i desire but now i want to use the value that user enters in the textbox and assign it to variable in my module.
My code for dynamically creating textbox.
Private Sub Userform_Initialize()
Dim i As Long
number = InputBox("Enter the number of floor", "Enter Floor Number")
Me.StartUpPosition = 0
Me.ScrollHeight = number * 21
Dim TxtB1 As Control
For i = 1 To number
Set TxtB1 = Controls.Add("Forms.TextBox.1")
With TxtB1
.Name = "TxtBox" & I
.Height = 20
.Width = 100
.Left = 20
.Top = 20 * i * 1
End With
Next i
End SubCan You please help me with the following.
I am actually working on a project and i need help with something.
I have to create multiple textbox dynamically and ask user to enter some values in that field and then use that value in my module(where i have written rest of the code for the program)
So i have successfully managed to dynamically create textbox as i desire but now i want to use the value that user enters in the textbox and assign it to variable in my module.
My code for dynamically creating textbox.
Private Sub Userform_Initialize()
Dim i As Long
number = InputBox("Enter the number of floor", "Enter Floor Number")
Me.StartUpPosition = 0
Me.ScrollHeight = number * 21
Dim TxtB1 As Control
For i = 1 To number
Set TxtB1 = Controls.Add("Forms.TextBox.1")
With TxtB1
.Name = "TxtBox" & I
.Height = 20
.Width = 100
.Left = 20
.Top = 20 * i * 1
End With
Next i
End SubCan You please help me with the following.