Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default semicolon delimiter in a cell

In a cell I have this values

;1,LPT,23;2,5;DD;5,5;ABC;6,5; etc......

How can I, using VB assign to an array-variable;
(semicolon delimiter ";")

Thanks

Coco


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default semicolon delimiter in a cell

Dim ary

ary = Split(ActiveCell.Value, ";")

--
HTH

Bob Phillips

"coco" wrote in message
...
In a cell I have this values

;1,LPT,23;2,5;DD;5,5;ABC;6,5; etc......

How can I, using VB assign to an array-variable;
(semicolon delimiter ";")

Thanks

Coco




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default semicolon delimiter in a cell

Something like...

Option Explicit
Sub testme()

Dim myVal As String
Dim mySplit As Variant
Dim iCtr As Long
myVal = ActiveSheet.Range("a1").Value

mySplit = Split(myVal, ";")
'mySplit = Split97(myVal, ";")

For iCtr = LBound(mySplit) To UBound(mySplit)
Debug.Print iCtr & "--" & mySplit(iCtr)
Next iCtr

End Sub
'from Tom Ogilvy
Function Split97(sStr As String, sdelim As String) As Variant
Split97 = Evaluate("{""" & _
Application.Substitute(sStr, sdelim, """,""") & """}")
End Function

=====
Split was added in xl2k. If you're using xl97, use Tom's Split97.

coco wrote:

In a cell I have this values

;1,LPT,23;2,5;DD;5,5;ABC;6,5; etc......

How can I, using VB assign to an array-variable;
(semicolon delimiter ";")

Thanks

Coco


--

Dave Peterson
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
How can I split contents of cell with no delimiter rebc Excel Discussion (Misc queries) 5 May 19th 23 07:46 PM
Separate values in cell by delimiter JR Excel Discussion (Misc queries) 13 February 6th 07 05:56 PM
how do i make a semicolon appear in every cell Paul Excel Discussion (Misc queries) 2 August 10th 06 10:53 PM
find and remove a string of a cell value with comma as delimiter yefei Excel Discussion (Misc queries) 3 February 28th 06 01:05 PM
Semicolon problem MavRiK[_3_] Excel Programming 0 September 30th 04 04:57 PM


All times are GMT +1. The time now is 10:15 PM.

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

About Us

"It's about Microsoft Excel"