Splitting

  • Thread starter Thread starter Tree*Rat
  • Start date Start date
T

Tree*Rat

how do i get VBA to split items that are seperated by a colon ;

ie this;that;andmore

split into vars

var1 = this
var2 = that
var3 = andmore

Idealy I it would be split into an array
 
The clue is in the subject

myVar = Split(the_text,";")

myVar is then a variant array.
 
To follow up on Bob's post... you can also declare a dynamic String variable
and assign the Split values to that instead.

Dim MyStringArray() As String
MyStringArray = Split(YourTextString, ";")

Note that all arrays created by the Split function are **always** zero-based
arrays (even if you use Option Base 1 in your code modules).
 
To follow up on Bob's post... you can also declare a dynamic String
variable and assign the Split values to that instead.

Dim MyStringArray() As String
MyStringArray = Split(YourTextString, ";")

Note that all arrays created by the Split function are **always**
zero-based arrays (even if you use Option Base 1 in your code
modules).

cool, thanks
 
Back
Top