N
Neal Ostrander
I am trying to read the individual characters of a textbox into the elements
of an array. The code I have is below. I keep getting an error on the line
that calls the mid() function that says the function can't be called in this
manner. I am just trying to learn VBA and would appreciate any help I could
get.
for example if the user enters "value" into the textbox then the elements of
the array should be:
sArray(0) = v
sArray(1) = a
sArray(2) = l
sArray(3) = u
sArray(4) = e
thanks in advance for any help
Neal
Dim iCounter As Integer
Dim sInput As String
Dim sArray() As String
sInput = txtInput.Value
ReDim sArray(Len(txtInput.Value))
For iCounter = 0 To UBound(sArray)
sArray(iCounter) = Mid(sInput, iCounter, 1)
Next iCounter
of an array. The code I have is below. I keep getting an error on the line
that calls the mid() function that says the function can't be called in this
manner. I am just trying to learn VBA and would appreciate any help I could
get.
for example if the user enters "value" into the textbox then the elements of
the array should be:
sArray(0) = v
sArray(1) = a
sArray(2) = l
sArray(3) = u
sArray(4) = e
thanks in advance for any help
Neal
Dim iCounter As Integer
Dim sInput As String
Dim sArray() As String
sInput = txtInput.Value
ReDim sArray(Len(txtInput.Value))
For iCounter = 0 To UBound(sArray)
sArray(iCounter) = Mid(sInput, iCounter, 1)
Next iCounter