Glory
Well-known Member
- Joined
- Mar 16, 2011
- Messages
- 640
The split function is supposed to return all the elements in a string that are separated by delimiters as distinct substrings, right?
I can only get one element. If range "A1" contains "a b c", then the following code only gives me "b". How do I get the other two substrings?
Public a(3)
I can only get one element. If range "A1" contains "a b c", then the following code only gives me "b". How do I get the other two substrings?
Public a(3)
Code:
Sub test2()
For i = 1 To 3
a(i) = Split(Right(Range("A1"), 3))
Range("B" & i).Value = a(i)
Next
End Sub