Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
don don is offline
external usenet poster
 
Posts: 1
Default Convert a string to an array

' Parse the comma separated string in the current cell into an array

Dim strArray As Variant
Dim intIndex As Integer

strArray = Split(ActiveCell.Value, ",")

If UBound(strArray) < 0 Then
Debug.Print "No string tokens found"
Else
For intIndex = 0 To UBound(strArray)
Debug.Print "Token(" & intIndex & ") = " & strArray(intIndex)
Next intIndex
End If

"pk" wrote in message
...
Does anyone know an easy/efficient method for converting a
comma separated string into a single column array?

i.e. string is passed in this format:

item1,item2,item3,itemx...

I need to parse and copy into an array.

Your example code would be greatly appreciated...thanks in
advance.



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
sum numbers in cell string array kookie Excel Worksheet Functions 6 April 10th 09 02:56 PM
search text string within array Geeban Excel Discussion (Misc queries) 5 September 16th 08 07:34 AM
Can one store a string in a Array element? [email protected] Excel Discussion (Misc queries) 1 April 17th 07 12:53 PM
last number array from string Michael Excel Worksheet Functions 17 August 1st 05 07:30 PM
Check if a String is inside an Array Alan Beban[_3_] Excel Programming 0 September 3rd 03 07:44 PM


All times are GMT +1. The time now is 01:40 PM.

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"