-
i want to create an array with a variable
r= "list","run","help","suck"
myaaray = array(r)
fitem = myarray(0) 'This returns of course "list","run","help","suck"
i want fitem to = the first item in the list ("list")
my question is how to do i make an array out of an already existing string.
-
You mean this?
Code:
MyString = Array("One", "Two", "Three", "Four")
Print MyString(2) 'returns 3
-
Or this?
Code:
Option Explicit
Option Compare Text
Option Base 0
Sub Whatever_Event()
Dim string_Ex As String, arrayEx() As String
string_Ex = "ss,dd,ee,rr,yy,gfgs,fsgsfthgjg, " _
"gfhgfds,gfdsg,fdsg,sfgs,dg,sdg,sf,dsg,f,gsfdg,fds,gf,gdfsd"
arrayEx = Split(string_Ex,",")
MsgBox arrayEx(4) 'Returns "ee"
End Sub
:confused: Fully.