#1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 12
Default Splitting

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
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2,420
Default Splitting

The clue is in the subject

myVar = Split(the_text,";")

myVar is then a variant array.

--
__________________________________
HTH

Bob

"Tree*Rat" wrote in message
6.253...
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



  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 5,934
Default Splitting

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).

--
Rick (MVP - Excel)


"Bob Phillips" wrote in message
...
The clue is in the subject

myVar = Split(the_text,";")

myVar is then a variant array.

--
__________________________________
HTH

Bob

"Tree*Rat" wrote in message
6.253...
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




  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 12
Default Splitting

"Rick Rothstein" wrote in
:

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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
splitting Last Name, First Name buggles Excel Discussion (Misc queries) 4 November 15th 07 01:07 AM
Splitting Text John Calder New Users to Excel 4 July 27th 07 04:00 AM
Splitting into Groups tay4432 Excel Worksheet Functions 6 June 25th 07 06:24 PM
Splitting a Cell williamr Excel Worksheet Functions 2 June 13th 07 01:30 AM
Splitting a cell David Excel Worksheet Functions 2 March 16th 06 07:36 PM


All times are GMT +1. The time now is 01:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"