View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary Keramidas Gary Keramidas is offline
external usenet poster
 
Posts: 2,494
Default Array of values in 1 textbox

not sure what you're trying to do, but this worked for me

Private Sub TextBox1_Change()
Dim mediaArray() As String
Dim i As Long
mediaArray = Split(textbox1.Value, vbNewLine)
For i = LBound(mediaArray) To UBound(mediaArray)
Debug.Print mediaArray(i)
Next
End Sub

--


Gary


"Justin" wrote in message
ups.com...
I'm having problems with a piece of code.
The form has two controls:
*Text Box
*Submit button

Users should be able to enter multiple lines in the textbox (this is
enabled) and each line is entered into a new row.

The code seems stuck in this section:
Dim mediaArray() As String
Dim count As Integer
Dim start As Integer
count = Split(txtMedia.Value, vbNewLine)
ReDim mediaArray(count) As String
mediaArray = txtMedia.Value

What am I doing wrong?

-Justin