Hi guys,
How can I collect user input and store them to an array so that I can loop through the array to display the input?. The user will provide 40 inputs and the inputs will be entered into an array.
Thank you.
You can try following code (colletcts 40 inputs and then shows them)
Sub Macro1() Dim myar(39) For i = 0 To 39 myar(i) = InputBox("Enter User Input") Next i For i = 0 To 39 myf = myf & myar(i) & vbCr Next i MsgBox myfEnd Sub
A user form with 40 TextBoxes or ComboBoxes on it?
What is the nature of the "user input"? Is it just strings, or is some of it numeric input?
Thanks, guys.
But is it possible if the user can just input the data to just one input box and separate data with a comma?.
So just one input box that collects 40 values separated with a comma and each value is stored into an array.
Thank you for your interest and help.
Sub Macro2()Dim myar() As String myt = InputBox("Enter User Input") myar() = Split(myt, ",") For i = 0 To 39 myf = myf & myar(i) & vbCr Next i MsgBox myfEnd Sub