2
Contributors
5
Replies
6
Views
5 Years
Discussion Span
Last Post by Jx_Man
1

You right sir, it works perfect with split function.
This what i am doing with split function :

Private Sub Command1_Click()
Dim temp As Variant
Dim str As String
str = "i,love,you,forever"
temp = Split(str, ",")
MsgBox temp(0) + vbCrLf + temp(1) + vbCrLf + temp(2) + vbCrLf + temp(3)
End Sub
Votes + Comments
Showing Good effort
3
MsgBox temp(0) + vbCrLf + temp(1) + vbCrLf + temp(2) + vbCrLf + temp(3)

You accessing array with this way..
How about if you have many words separated with commas?
Are you want to get all data by write it one by one?
Use looping and Ubound to get last index of array

Private Sub Command1_Click()
Dim temp As Variant
Dim str As String
Dim arr As String
str = "i,love,you,forever"
temp = Split(str, ",")

For i = 0 To UBound(temp) ' get the last index with Ubound
    arr = arr + temp(i) + vbCrLf ' Read data until last index and store it on arr
Next i
MsgBox arr ' display it on message box
End Sub
Votes + Comments
Good Point here.. :D
good point.
You enlighten me so much sir..Thank you :)
0

Wow, it's great sir.
Thank you for sharing sir. You enlighten me so much..

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.