Collect user input to an array in VBA

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.

Parents
No Data
Reply
  • 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 myf
    End Sub

Children
No Data